🔊
Loads audio data from a file and returns a Sound object.
Use functions like play, pause, and stop to
control playback. Note that sounds can only be played after the
first user interaction with the page!
Set volume to a value between 0 (silent) and 1 (full volume).
Set pan to a value between -1 (left) and 1 (right) to adjust
the sound's stereo position. Set loop to true to loop the sound.
Use loaded, paused, and ended to check the sound's status.
The entire sound file must be loaded before playback can start, use await to wait for a sound to load. To stream larger audio files use the loadAudio function instead.
🔊 Loads audio data from a file and returns a
Soundobject.Use functions like
play,pause, andstopto control playback. Note that sounds can only be played after the first user interaction with the page!Set
volumeto a value between 0 (silent) and 1 (full volume). Setpanto a value between -1 (left) and 1 (right) to adjust the sound's stereo position. Setloopto true to loop the sound.Use
loaded,paused, andendedto check the sound's status.The entire sound file must be loaded before playback can start, use
awaitto wait for a sound to load. To stream larger audio files use theloadAudiofunction instead.