API

Class StreamingSoundAbstract

Abstract class representing a streaming sound.

A streaming sound has a sound buffer that is loaded into memory in chunks as it is played. This allows it to be played more quickly than a static sound, but it also means that it cannot have loop points or playback rate changes.

Due to the way streaming sounds are typically implemented, there can be a significant delay when attempting to play a streaming sound for the first time. To prevent this delay, it is recommended to preload instances of the sound using the IStreamingSoundStoredOptions.preloadCount options, or the preloadInstanceAsync and preloadInstancesAsync methods before calling the play method.

Streaming sounds are created by the CreateStreamingSoundAsync function.

Hierarchy (View Summary)

Index

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.

  • Preloads the given number of instances of the sound.

    Parameters

    • count: number

      The number of instances to preload.

    Returns Promise<void>

    A promise that resolves when all instances are preloaded.