@moonshine-ai/moonshine-js
    Preparing search index...

    Class MediaElementTranscriber

    Transcribes the output of an <audio> or <video> HTML element.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    audioContext: AudioContext
    isActive: boolean = false

    Methods

    • Attaches a MediaStream to this Transcriber for transcription. A MediaStream must be attached before starting transcription.

      Parameters

      • stream: MediaStream

        A MediaStream to transcribe

      Returns void

    • Returns the most recent AudioBuffer that was input to the underlying model for text generation. This is useful in cases where we want to double-check the audio being input to the model while debugging.

      Parameters

      • buffer: Float32Array

      Returns AudioBuffer

      An AudioBuffer

    • Preloads the models and initializes the buffer required for transcription.

      Returns Promise<void>