API

Class StaticSoundAbstract

Abstract class representing a static sound.

A static sound has a sound buffer that is loaded into memory all at once. This allows it to have more capabilities than a streaming sound, such as loop points and playback rate changes, but it also means that the sound must be fully downloaded and decoded before it can be played, which may take a long time for sounds with long durations.

To prevent downloading and decoding a sound multiple times, a sound's buffer can be shared with other sounds. See CreateSoundBufferAsync, StaticSoundBuffer and StaticSound.buffer for more information.

Static sounds are created by the CreateSoundAsync function.

Hierarchy (View Summary)

Index

The sound buffer that the sound uses.

This buffer can be shared with other static sounds.

The audio engine this node belongs to.

onDisposeObservable: Observable<AbstractAudioNode> = ...

Observable for when the audio node is disposed.

onEndedObservable: Observable<AbstractSound> = ...

Observable for when the sound stops playing.

onNameChangedObservable: Observable<
    { newName: string; node: AbstractNamedAudioNode; oldName: string },
> = ...

Observable for when the audio node is renamed.

The stereo features of the sound.