How to make start and stop music by clicking on the same button?

Hello, I have UE 5.4.1

After 3 day on diving into YouTuBe tutorials and UE documentation I´m lost with creating such simple thing as strat and stop music function by clicking on same button in UI blueprint.

I´ve created UI with ONE button that I need to play music after first click and stop after second one.
I imported sound wav and created cue from it that I need to play. It sould be global sound that should play while traveling through the app.

I´ve tried to connect my OnClicked button on FlipFlop function > A node is for Start 2D Sound (selected sound cue) and B node to Stop audio component. Also, I´ve created variable Audio Component inside the UI blueprint.

Problem is that I can not find my sound cue or wav in Audio Componentz > Details > Sound. I have bot files in my content browser but engine does not see them.

Question:

  1. Where should I put these files to reveal them into the Sound > Details menu?
  2. Could someone advide me some another workaround, please?

Hey @Alwin43535! Welcome to the forums!

Try this!

Let me know how it goes! :slight_smile:

hello sir I want to know what’s the meaning of the “Radio” of your blueprint. Is it as a virable?

Hey @HelloMHL, it is a sound object reference variable, you can make sure the type is correct by using “Promote to Variable” on the “Return value” of the “Spawn Sound 2D”. Then build the rest of it using that variable!

Hope this helps!