@ujjwalvivek/tinyts
    Preparing search index...

    Class AudioHandle

    Handle for controlling a playing sound in real time.

    Index

    Constructors

    Properties

    _done: boolean = false
    _voice: Voice | null = null
    onEnd?: () => void

    Callback when the sound finishes.

    Accessors

    • get done(): boolean

      True once the sound has finished playing (naturally or via stop).

      Returns boolean

    • get group(): string

      The group this sound belongs to.

      Returns string

    • get tag(): string

      The tag this sound was created with.

      Returns string

    Methods

    • Fade out to silence over duration in seconds, then stop.

      Parameters

      • duration: number

      Returns void

    • Fade to a target volume over duration in seconds.

      Parameters

      • vol: number
      • duration: number

      Returns void

    • Set stereo pan (-1 left, 0 center, 1 right).

      Parameters

      • p: number

      Returns void

    • Set playback rate / pitch shift.

      Parameters

      • p: number

      Returns void

    • Set playback volume (0-1).

      Parameters

      • v: number

      Returns void