dacha
    Preparing search index...

    Class Audio

    Audio asset. Points to a sound file played by the audio system. Its MediaAsset.resource is an AudioBuffer.

    Hierarchy (View Summary)

    Index
    id: string

    Unique identifier of the asset

    name: string

    Name of the asset

    src: string

    Path to the sound file

    assetName: string

    The name the configuration uses for the asset kind, such as texture.

    DefineAsset sets it, so a game usually does not assign it.

    • get resource(): R | undefined

      The loaded resource, or undefined while it is not loaded.

      Returns R | undefined

    • Frees what the resource holds, such as GPU memory. Optional.

      Parameters

      • resource: AudioBuffer

      Returns void

    • Fetches the file and returns the resource.

      Returns Promise<AudioBuffer>