Sound Effects and Background Music

Can anyone give me an idea how to implement a dynamic sound effects and background music?

I have a settings for turning on and off a sound effects and background music, how can I turn off all sound effects in my game when I turned it off?same with background music.

Thank you in advance.

This is only my way to do it, I don’t know if there is a better way

Set a Scene variable or Global variable when you turn off the sound.
variable is_sound_on = 1
Set all sounds to a specifc voume
variable is_sound_on = 0
Set all sounds to volume 0

1 Like

To further control your sounds/music never play them just like that. Assign a channel number and play it there. Then at any point in the game you can tell the pause, stop, start, control volume, …

As the number of channels is limited, I only put sounds that I need to control here, e.g. background music. But the shooting sound or an explosion would never get cut off anyway so I just play them without a channel.

What exactly do you mean by dynamic sound effects?

1 Like

Thanks for sharing your solution :grin:

Basically I just used dynamic sound effects term same with the idea of turning on and off the sounds and music.

Anyways, thank you for clarification. :grin: