Turn audio into text you can search, summarize, or act on. Transcribe a file, then feed the transcript straight into a model to build a voice-driven feature.
Why: a transcription model takes audio and returns text — the foundation of voice notes, meeting summaries, and voice commands. When: use it whenever the input arrives as speech; the output text then flows into any normal LLM pipeline. Where: providers cap file size and duration, so long audio must be chunked or pre-processed.
# Transcription is provider-specific (OpenAI Whisper here).
from openai import OpenAI
client = OpenAI()
with open("meeting.mp3", "rb") as audio:
result = client.audio.transcriptions.create(
model="whisper-1",
file=audio,
)
print(result.text)Why: transcription alone gives raw text — the value comes from what you do next, like summarizing a meeting or extracting action items. When: pipe the transcript into an LLM call to turn speech into a structured, useful result. Where: this "STT → LLM" chain is the whole pattern behind voice assistants and meeting tools.
import anthropic
claude = anthropic.Anthropic()
transcript = result.text # from the transcription call above
summary = claude.messages.create(
model="claude-opus-4-8", max_tokens=512,
messages=[{"role": "user", "content":
f"Summarize this meeting and list action items:\n\n{transcript}"}],
)
print(summary.content[0].text)Why: real audio is long, noisy, and multi-speaker — you hit size limits and accuracy drops, so you must split files and set expectations. When: chunk audio on silence into sub-limit segments, transcribe each, then stitch; provide a language hint when known. Where: test on real recordings (accents, background noise), not clean studio samples.
Long/messy audio strategy:
1. Split on silence into segments under the API's size limit
2. Transcribe each segment (optionally pass a language hint)
3. Concatenate transcripts in order
4. For "who said what", use a model/service with speaker diarization
Always validate on noisy, accented, real-world audio before shipping.