Skip to content

Sound functions

Free functions you can call directly in sprite code.

getSound(soundName: string): Sound

Get a sound object by name.

Delegates to Sprite.getSound

playSoundUntilDone(sound: string): void

Play a sound and wait until it finishes.

Pauses the script (a generator). In sprite code the free-function wrapper awaits it for you.

Delegates to Sprite.playSoundUntilDone

startSound(sound: string): void

Start playing a sound without waiting.

Pauses the script (a generator). In sprite code the free-function wrapper awaits it for you.

Delegates to Sprite.startSound

stopAllOfMySounds(): void

Stop all sounds played by this sprite.

Delegates to Sprite.stopAllOfMySounds

stopAllSounds(): void

Stop all sounds in the project.

Delegates to Sprite.stopAllSounds