# Is there a way to stop all sounds?

**URL:** <https://forum.defold.com/t/is-there-a-way-to-stop-all-sounds/75622>\
**Category:** Questions\
**Created:** [January 9, 2024, 1:33pm UTC](https://forum.defold.com/t/is-there-a-way-to-stop-all-sounds/75622 "2024-01-09T13:33:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Encario](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/encario/32/33162_2.png) [@Encario](https://forum.defold.com/u/Encario)\
**Post date:** [January 9, 2024, 1:33pm UTC](https://forum.defold.com/t/is-there-a-way-to-stop-all-sounds/75622/1 "2024-01-09T13:33:18Z")

</div>

I’m adding more sound aspects to my game, and I’m wondering if there’s a way to do sound.stop() for all current sounds, instead of just having to go one by one stopping all the sounds that could be playing.

---

<div class="post-metadata">

**Author:** ![Pawel](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pawel/32/24623_2.png) [@Pawel](https://forum.defold.com/u/Pawel)\
**Post date:** [January 9, 2024, 2:00pm UTC](https://forum.defold.com/t/is-there-a-way-to-stop-all-sounds/75622/2 "2024-01-09T14:00:07Z")

</div>

For this, e.g. I have a module that is managing all the sounds I want to play or stop (and I also have all the sound components collected in one game object that is receiving messages to play given sound as “event”)

You can then write a script in the same game object that have all sound components and add more functionalities (fading in, out, delays, gains, etc), for example:

```
function on_message(self, message_id, message, sender)
   if message_id == m.MUSIC then -- for example differentiate background music 
	sound_manager.manage_music(message.name, message.attack, message.decay, message.gain, message.speed)
elseif message_id == m.PLAY then -- and SFX
	sound_manager.manage_play(message.name, message.gate, message.attack, message.gain,
		message.speed, message.gain_variation, message.custom_cb)
elseif message_id == m.STOP then
	sound_manager.manage_stop(message.name, message.decay, message.open_now)
end
end

```

I have such module in WIP state, it might be released soon 😉
