Download

Not found Stop Sound In UMG

In widget blueprint i create two buttons ( Play - Stop )
and i link play button with 2d sound
but i realized i can’t find stop sound to link to stop button , i think this not available in UMG , if there another way to stop sound , please tell me how to do this.

Regards,

Your use case might help shed light on the issue.

What sound are you playing and why stop it? If its a super long sound like music for example you might want to stop it somewhere else?

Thanks for replay

Yeah it’s long sound Music list and with two buttons Play and stop.

Maybe this will help If I play a sound at location in a BP how can I stop that sound from playing? - UE4 AnswerHub

**Didn’t solve this problem yet
anyway here is snapshot

Recorders Buttons Widget :**

&stc=1

**Play Function Work!! :
**

&stc=1

**Stop Function :
**

&stc=1

**Recorders Buttons Widget BP :
**

&stc=1

**Recorders Buttons Widget BP Event Graph :
**

&stc=1

**RecordersStructures
**

&stc=1

**Stop Sound Not Available to bad :frowning: :
**

&stc=1

So how we can solve this:(

I think your best bet is to remove all that stuff and do a on event click cast to another blueprint. An actor blueprint. You can use your game blueprint and then in the game blueprint set your audio component to the sound selected by the array.
That way you can get the audio component and select stop.

You will have to do the same for the stop button.
Doesnt look like you can add audio components to UMG and by the looks of it you will need one.

Can you give me example by Screenshot ?

Well actually forget about the game blueprint. You are already casting to your character i see.
On your character add a Audio component.

Create a custom event in your character blueprint.
Call it Start Music or something like that. Create another one called Stop Music.

Then In your UMG after you cast to you character run the custom event.

And at your custom events you add your logic and then play sound and stop sound.

I can give screenshots but it will have to wait till later today unfortunately. Basically you need to control your music on your character… drag n drop the audio component into the event graph on your character and when you drag from it you will the option to stop.

You just need to set the audio to play by doing that stuff that was in the answerhub post.

Okay thanks for the help i will try what you told me after finish my duty

Three Days i tried to solve this problem :frowning:

Still didn’t work Audio Component , i edit Structure and add variable to Audio Component and i follow your instructions, but it seems doesn’t work
here screen shot

Structure :

&stc=1

For Pickup Function My Character , Work !!!

&stc=1

As you told me add custom event Play - Stop.

I tried this method my character

&stc=1

And my method

&stc=1

I add audio Component to my character :

&stc=1

and this my widget Button for play and stop

&stc=1

And the result Failed :confused:

The main goal that i want to achieve it , by structure , i add Variable ( Audio Component )

&stc=1

And when i go to me blueprint actor the Audio Component not show in the list :

&stc=1

And when i drag drop actor to level >>>

&stc=1

Finally

&stc=1

Please Help me to achieve this

In your event where you say play… you are almost correct.
Before you say play set the audio component and then play it.

f8006c70114ae6d5f495c77285c7c81c97f901b9.jpeg

So use your method but add the set audio component before you play it.
It might be the reason why its not working is because there is nothing to play.

It’s work !! thanks
OMG !! why i forgot about Set Sound !!!
Big Thanks Crocopede you are awesome !!

Great stuff. Good luck with your project.

I know this is an old post but this is the way i did it.

Right click, Create Sound 2D (Select the sound you want) then Promote it to a variable, I named mine BGM, then drag from the Return Value of your BGM and type Play.
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_129793_1518920746081_528”}[/ATTACH]

Then Get the BGM reference that you have, drag from the Return Value and type Stop.

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_129794_1518920733678_125”,“title”:“PlayStopMusicUMG_02.jpg”}[/ATTACH]