Streaming
Transcription
Transcribes audio into the input language.
npm i @xsai/stream-transcriptionExamples
Before using this package, please verify that your provider supports "stream": true.
Basic
import { streamTranscription } from '@xsai/stream-transcription'
import { openAsBlob } from 'node:fs'
const { textStream } = streamTranscription({
apiKey: '',
baseURL: 'https://api.openai.com/v1/',
file: await openAsBlob('./test/fixtures/basic.wav', { type: 'audio/wav' }),
fileName: 'basic.wav',
language: 'en',
model: 'gpt-4o-transcribe',
})