tjbot-ce - v3.0.0
    Preparing search index...

    Interface STTEngineAbstract

    Abstract base class for speech-to-text engines. Implementations must extend this class and implement initialize() and transcribe().

    interface STTEngine {
        cleanup?(): Promise<void>;
        initialize(
            microphoneRate: number,
            microphoneChannels: number,
        ): Promise<void>;
        transcribe(
            micStream: ReadableStream,
            options: STTRequestOptions,
        ): Promise<string>;
    }
    Index

    Methods

    • Clean up resources used by the STT engine. Optional method for backends that need to release resources.

      Returns Promise<void>

    • Initialize the STT engine. Must be called before transcribe().

      Parameters

      • microphoneRate: number

        Sample rate of the microphone audio (e.g., 44100)

      • microphoneChannels: number

        Number of audio channels from the microphone (e.g., 2 for stereo)

      Returns Promise<void>

      if initialization fails

    • Transcribe audio from a microphone stream.

      Parameters

      • micStream: ReadableStream

        The readable stream from the microphone

      • options: STTRequestOptions

        Configuration options for transcription

      Returns Promise<string>

      The transcribed text

      if transcription fails or stream is unavailable