Playing and Stopping Sounds


Sounds are created then played or stopped in routines.
See the reference guide for details.

For most portability, use mp3 files for your sounds. These should play on all major platforms.

The name of your sound file must be inside double quotations marks.

The example below will play the sound, then stop it after 3 seconds.

Playing Sound


editable
This example uses an empty sprite to set a wait time. When the timer expires, the sound is stopped.

Muting and Pausing Sounds

When a sound is playing you can pause the sound or mute it. Of course you can also unpause and unmute. Muting and pausing support fading as appropriate.


editable
This example uses an empty sprite to set a wait time..

Cloning Sounds

When you create a sound and play it, playing it again will cancel the instance that is already playing. This doesn't sound good.

To play multiple copies of the same sound at the same time, use cloning.
You clone a sound, update any values for the new clone instance, and it immediately plays.
You can still mute or pause the clone if you assigned it a name.


editable
This example uses an empty sprite to set a wait time. When the timer expires, the sound is stopped.