Skip to main content

createSound

Create a sound.

Syntax

engine.audio.createSound(soundName, options, withId);

Parameters

NameTypeDescription
soundNamestringThe name of the sound to create.
options (optional)SoundOptionsThe options to use for the sound.
withId (optional)stringThe ID of the sound to create.

Returns

Example

const sound = engine.audio.createSound('fire', {
position: [0, 2, 0],
});

sound.play();

Available on: Client