Skip to content

sound

Plays and adjusts the sounds a sprite declares. See Costumes and sounds for loading the files.

sprite Cat {
sound "./assets/meow.wav";
events.onClick() {
sound.setVolume(50);
sound.playUntilDone("meow");
}
}

The sound "./file.wav"; declaration still works. Only sound. selects the namespace.

sound.play(name: str) -> void ✅ # keeps going while the sound plays
sound.playUntilDone(name: str) -> void ✅ # waits for the sound to finish
sound.stopAll() -> void ✅
sound.setEffect(effect: SoundEffect, value: num) -> void ✅
sound.changeEffect(effect: SoundEffect, change: num) -> void ✅
sound.clearEffects() -> void ✅
sound.setEffect(sound.SoundEffect.PITCH, 10);
sound.setEffect("PITCH", 10); # identical
sound.SoundEffect Value
PITCH "PITCH"
PAN "PAN"
sound.setVolume(volume: num) -> void ✅
sound.changeVolume(change: num) -> void ✅
sound.volume() -> num ✅