Member Junction
    Preparing search index...

    Class BaseAudioGeneratorAbstract

    Base class for audio models that carries both text-to-speech and speech-to-text. Not all sub-classes support all methods: an unsupported method throws, and GetSupportedMethods names the ones a sub-class implements.

    It spans two model types (TTS and Speech to Text), so it has been split. It stays, and keeps working, for drivers and callers that already use it: it implements both halves, so any of its drivers can be used where either new base class is expected. The drivers MemberJunction ships still extend it and are also registered against the new class or classes they implement, under the same keys.

    Use BaseTextToSpeech for text-to-speech and BaseSpeechToText for speech-to-text. An application that overrides a shipped audio driver must also register the override against the new class or classes that driver implements, under the same key, for example @RegisterClass(BaseTextToSpeech, 'OpenAIAudioGenerator'). The ClassFactory keeps registrations per base class, and the text-to-speech and speech-to-text runners resolve drivers through the new classes, so an override registered only against BaseAudioGenerator is not used by them.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    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>