API reference
Preparing search index…

Decode and play long audio in blocks without loading all samples into memory at once.

Type hierarchy

Hierarchy (View Summary)

Source & inheritance
Member directory69

Constructors

Properties

Methods

Constructors

Properties

ready: Promise<boolean>

Result of Worker initialization and initial data preparation; await before playback.

Source & inheritance
times: BigInt64Array
Source & inheritance
values: Float32Array
Source & inheritance
Cone: typeof Cone = Cone

Directional cone configuration type.

Source & inheritance
Status: typeof SoundStatus = SoundStatus

Playback status enumeration.

Source & inheritance
TimeSpan: typeof TimeSpan = TimeSpan

Time span type for the loop region.

Source & inheritance

Methods

  • Stop playback and asynchronously close the decoding data source. Inside this object's own audio callback, only request closure; actual cleanup completes after that callback ends.

    Returns

    Promise<void>
    Source & inheritance
  • Return the latest streaming decoder pump error, or undefined if no pump is used or no error exists.

    Returns

    undefined | Error
    Source & inheritance
  • Fill interleaved 16-bit PCM on the object's owning JS thread; await super to read the current file. samples references a reusable native slot, valid only until the callback ends; false denotes the final block.

    Parameters

    Returns

    boolean | Promise<boolean>
    Source & inheritance
  • Called on the object's owning JS thread while preparing the final block; return the next loop's interleaved sample offset. super returns the file's loop region or EOF position; undefined means no loop. The audio consumer thread initiates the actual seek, then asynchronously delegates to onSeek.

    Returns

    undefined | bigint | Promise<undefined | bigint>
    Source & inheritance
  • Seek on the object's owning JS thread; await super performs the current file's default seek.

    Parameters

    offset

    Returns

    void | Promise<void>
    Source & inheritance
  • Asynchronously open an audio file for streaming and return whether it succeeded; does not call play automatically.

    Parameters

    filename
    string

    Returns

    Promise<boolean>
    Source & inheritance
  • Asynchronously open encoded audio bytes for streaming, returning whether it succeeded.

    Parameters

    data
    Uint8Array

    Returns

    Promise<boolean>
    Source & inheritance
  • Asynchronously open a seekable stream, retaining the data source needed for decoding until close.

    Parameters

    Returns

    Promise<boolean>
    Source & inheritance

Symbol members

"[audioHandle]": AudioHandle<"source">
Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0