Engine API Reference - v2.23.0-beta.17
    Preparing search index...

    Class Sound

    Represents the raw audio data of a playable sound. A Sound is the resource of an audio Asset. An audio asset can be assigned to a SoundSlot owned by a SoundComponent.

    The buffer is the decoded Web Audio AudioBuffer, so duration is known as soon as the asset has loaded. Playing a sound creates one SoundInstance per playback, normally through a slot rather than by constructing the instance directly.

    Index
    buffer: AudioBuffer

    Contains the decoded audio data.

    • get duration(): number

      Gets the duration of the sound. If the sound is not loaded it returns 0.

      Returns number