playSound
Play a sound and automatically dispose of it when it's done playing.
Syntax
engine.audio.playSound(soundName, options, withId);
Parameters
Name | Type | Description |
---|---|---|
soundName | string | The name of the sound to create. |
options (optional) | SoundOptions | The options to use for the sound. |
withId (optional) | string | The ID of the sound to create. |
Returns
SoundManager
- The sound manager.
Example
const audio = engine.audio.playSound('fire', {
volume: 0.5,
});
audio.play();
Available on: Client