wavesurfer.js
    Preparing search index...

    Class default

    Hierarchy

    Index
    scope: Scope = ...

    A disposal scope owned by the plugin chassis, disposed by destroy(). definePlugin (see define-plugin.ts) replaces this with a fresh Scope on every (re-)init; class-based plugins that support destroy() -> _init() re-init must do the same in onInit().

    subscriptions: (() => void)[] = []
    wavesurfer?: default
    • get destroyed(): boolean

      Whether destroy() has been called. Subclasses use this to guard async work.

      Returns boolean

    • Do not call directly, only called by WavesSurfer internally

      Parameters

      Returns void

    • Destroy the plugin

      Returns void

    • Emit an event

      Type Parameters

      • EventName extends
            | "destroy"
            | "record-end"
            | "record-start"
            | "record-pause"
            | "record-resume"
            | "record-progress"
            | "record-data-available"

      Parameters

      Returns void

    • Get the duration of the recording

      Returns number

    • Returns boolean

    • Returns boolean

    • Check if the audio is being recorded

      Returns boolean

    • Subscribe to an event. Returns an unsubscribe function.

      Type Parameters

      • EventName extends
            | "destroy"
            | "record-end"
            | "record-start"
            | "record-pause"
            | "record-resume"
            | "record-progress"
            | "record-data-available"

      Parameters

      Returns () => void

    • Subscribe to an event only once

      Type Parameters

      • EventName extends
            | "destroy"
            | "record-end"
            | "record-start"
            | "record-pause"
            | "record-resume"
            | "record-progress"
            | "record-data-available"

      Parameters

      Returns () => void

    • Called after this.wavesurfer is available

      Returns void

    • Pause the recording

      Returns void

    • Parameters

      • stream: MediaStream

      Returns MicStream

    • Resume the recording

      Returns void

    • Request access to the microphone and start monitoring incoming audio

      Parameters

      • Optionaloptions: MediaTrackConstraints

      Returns Promise<MediaStream>

    • Start recording audio from the microphone.

      Calling this while a recording is already active restarts: the previous session is discarded (no 'record-end' is emitted for it -- call stopRecording() first if you want its final blob).

      Parameters

      • Optionaloptions: MediaTrackConstraints

      Returns Promise<void>

    • Stop monitoring incoming audio

      Returns void

    • Stop the recording

      Returns void

    • Unsubscribe from an event

      Type Parameters

      • EventName extends
            | "destroy"
            | "record-end"
            | "record-start"
            | "record-pause"
            | "record-resume"
            | "record-progress"
            | "record-data-available"

      Parameters

      Returns void

    • Clear all events

      Returns void

    • Get a list of available audio devices You can use this to get the device ID of the microphone to use with the startMic and startRecording methods Will return an empty array if the browser doesn't support the MediaDevices API or if the user has not granted access to the microphone You can ask for permission to the microphone by calling startMic

      Returns Promise<MediaDeviceInfo[]>