stop

Stop a built-in melody from playing.

music.baDing.stop()

If the built-in melody is currently playing, it will stop. If you decide to play the melody again it will start from the beginning. It won’t resume from the point where you stopped it.

There are several built-in melodies which you can play in your game. When using blocks, a melody is chosen from a dropdown list. In JavaScript, an instance of one of the built-in melodies is referenced in your code. You call the stop function from that instance of the melody, just like this:

music.baDing.stop()

To understand how melodies are created for use in arcade, take a look at the developer sound page.

Example

Loop the the power up melody. Wait for 5 seconds and then stop it.

music.powerUp.loop()
pause(5000)
music.powerUp.stop()

See also

play, play until done, loop

mixer