Audio transcription
Convert uploaded recordings into searchable text.
AI Tools · Function
experimental_transcribe generates a transcript from an audio file using a transcription model. It accepts audio data or a URL and returns the completed transcript as text.
experimental_transcribe is imported as transcribe and called with a transcription model plus audio content. It returns a result whose text field contains the complete transcript; provider-specific configuration can be supplied through providerOptions.
experimental_transcribe({ model, audio, providerOptions? }) → Promise<{ text: string; ... }>| Name | Type | Description |
|---|---|---|
model | TranscriptionModelV2 | The transcription model to use. |
audio | DataContent (string | Uint8Array | ArrayBuffer | Buffer) | URL | The audio file to generate the transcript from. |
providerOptions | Record<string, Record<string, JSONValue>> | Provider- or model-specific settings. |
An object containing text, the complete transcribed text from the audio input.
model property.audio.text property for the full transcript.providerOptions for provider-specific transcription settings.import { experimental_transcribe as transcribe } from 'ai';
import { openai } from '@ai-sdk/openai';
import { readFile } from 'fs/promises';
const { text } = await transcribe({
model: openai.transcription('whisper-1'),
audio: await readFile('audio.mp3'),
});
console.log(text);Reads an audio file, sends it to an OpenAI transcription model, and prints the returned transcript.
Convert uploaded recordings into searchable text.
Create captions or notes from prerecorded audio.
Use provider-specific transcription controls.
transcribeTranscriptionModelV2providerOptionsexperimental_streamTranscribe