Stopping Sound using Attributes

The stop button does not work in the following code.

Code Editor -,30253386,30253389,30129174,30253390,30253348

Editor -

Also I would like to make sure when any of the audio sounds are played. Whatever was playing before stops. Ex: if Jazz is playing and Country is clicked, then Jazz should stop.

Thank you,

Hi @Krish_USCan,

Try calling stop on the sound component of the entity, not the script instance:


To stop all sounds played on a sound component, just call the same method without providing any sound name as a parameter.

Oh that works thank you.

But is there a way to solve my second problem.
Do let me know if my explanation makes sense or not.


1 Like

Now if you are talking of stopping all sounds playing currently app-wide you will have to use a custom system for that. Leverage app events, on each entity holding sounds add an event like this:'sounds:stopAll', function(){
}, this);

Now from any script in your app you can call the following event and all sounds playing will stop.'sounds:stopAll');

Hi, this is an old topic, but I was wondering how you unpause/start the sound again.

Hi @Kyle_3_1415!'Name of slot');

Thanks, I was trying different stuff, but I never thought of ‘play’… :sweat_smile:

1 Like

You can store the instance of the sound in a variable and control the functions like play, pause and other things with the variable