Interface ISpeechToTextProvider

Minimal interface for a speech-to-text provider.

This is kept intentionally narrow to avoid coupling the multimodal indexer to a specific STT service. Any service that can transcribe audio buffers satisfies this contract.

Example

const sttProvider: ISpeechToTextProvider = {
transcribe: async (audio, language) => {
const response = await openai.audio.transcriptions.create({
model: 'whisper-1',
file: audio,
language,
});
return response.text;
},
};
interface ISpeechToTextProvider {
    transcribe(audio, language?): Promise<string>;
}

Implemented by

Methods

Methods

  • Transcribe audio data to text.

    Parameters

    • audio: Buffer<ArrayBufferLike>

      Raw audio data as a Buffer.

    • Optional language: string

      Optional BCP-47 language code hint.

    Returns Promise<string>

    The transcribed text.