Configuration options for playing sound effects with the playSfx function. Allows specifying the audio source to play, optional volume level (0-1), and whether the sound should loop continuously.
const audioSource = this.assetManager.getAudio("audio/sfx/coin.ogg");playSfx({ audioSource }); Copy
const audioSource = this.assetManager.getAudio("audio/sfx/coin.ogg");playSfx({ audioSource });
const audioSource = this.assetManager.getAudio("audio/sfx/coin.ogg");playSfx({ audioSource, volume: 0.5 }); Copy
const audioSource = this.assetManager.getAudio("audio/sfx/coin.ogg");playSfx({ audioSource, volume: 0.5 });
const audioSource = this.assetManager.getAudio("audio/sfx/coin.ogg");playSfx({ audioSource, loop: true }); Copy
const audioSource = this.assetManager.getAudio("audio/sfx/coin.ogg");playSfx({ audioSource, loop: true });
Optional
Configuration options for playing sound effects with the playSfx function. Allows specifying the audio source to play, optional volume level (0-1), and whether the sound should loop continuously.
Example
Example
Example