Game Maker
File:If a sound is playing.png

This action's popup window

If a sound is playing the next action is performed. Otherwise it is skipped. You can select Not to indicate that the next action should be performed if the indicated sound is not playing. For example, you can check whether some background music is playing and, if not, start some new background music. Note that this action returns true when the sound actually plays through the speakers. After you call the action to play a sound it does not immediately reach the speakers so the action might still return false for a while. Similar, when the sound is stopped you still hear it for a while (e.g. because of echo) and the action will still return true.

See Also[]