Member Junction
    Preparing search index...

    OpenAI audio: text-to-speech (gpt-4o-mini-tts) and speech-to-text (Whisper).

    It does both, so it is registered against BaseTextToSpeech and BaseSpeechToText under the key model metadata names. It still extends, and is registered against, BaseAudioGenerator, so callers that resolve it through the old base keep working.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Splitter: AudioSplitter = null

    Optional splitter used only when audio exceeds OpenAI's upload ceiling. See AudioSplitter for why splitting is injected rather than bundled.

    Accessors

    • get apiKey(): string

      Only sub-classes can access the API key

      Returns string

    Methods

    • Transcribes audio that may exceed the provider's upload ceiling, splitting it first when it does. See TranscribeAudioWithSplitting, which this calls, for the behavior.

      Parameters

      • audio: Buffer

        The full audio to transcribe

      • maxUploadBytes: number

        The provider's hard upload ceiling

      • splitTargetBytes: number

        Target piece size, below the ceiling to leave room for multipart framing

      • splitter: AudioSplitter

        Splitter to use for oversized audio; may be null, in which case oversized audio fails

      • providerLabel: string

        Provider name, used in the size-limit error messages

      • transcribeOne: (piece: Buffer, cancellationToken?: AbortSignal) => Promise<TranscriptionPiece>

        Transcribes a single piece already known to be within the ceiling, and is handed cancellationToken to forward to its request

      • OptionalcancellationToken: AbortSignal

        Cancels the transcription: no further piece is sent once it aborts

      Returns Promise<TranscriptionPiece>