Sound overlapping in Widgets

Hi!

I’m making a fairly UI-intensive application with the Unreal Engine. My setup is as follows:

In widgets, clicking on one of the buttons opens up a textbox with text. I want it to also play an audio file, in this case a recorded narration of the text itself. I tried to do it the easy way by just selecting the sound in the “pressed” option in the button details but if the user then clicks on another button that second audio file will unfortunately overlap the audio created from the first button click. I think you see the problem here. How would I go about to have the narration audio play UNTIL the user clicks another button in which case the sound will stop and the new sound will start to play instead?

I’m not a programmer and not particular confident with blueprints either so if there is a solution please explain it in an easy to follow way.

Thanks! :slight_smile:

I’ve made it this way, you only need a reference to an audio component, you create a sound 2d every time you press the button, if there is something playing, stop it and, play the one pressed and then reference it as the currently playing one so other buttons can see there is something playing and be able to stop it

Hope you can see it clearly