Audio AI: Transcription, Diarization, and Analysis
A sales team records 50 calls a day. Managers cannot listen to all of them. Audio AI turns each recording into a searchable transcript with speaker labels, action items, and sentiment signal in seconds. This module covers how the full pipeline works: from raw waveform to structured insight.
By the end of this module you will be able to
Explain how Whisper-class ASR converts raw audio into text using mel spectrograms and a transformer architecture
Describe speaker diarization: what it solves, how speaker embeddings work, and how diarization combines with transcription
Design a post-transcript LLM pipeline for meeting analysis, action item extraction, and per-speaker sentiment
Choose between real-time streaming transcription and batch processing based on enterprise use case requirements
Why Audio AI Matters Now
Most enterprise audio is dark data. Calls, meetings, interviews, and earnings calls are recorded but rarely analyzed at scale because listening is linear: one hour of audio takes one hour to review. Text is random-access: a one-hour call becomes a 2,000-word transcript you can search, summarize, and feed into an LLM in milliseconds.
The pipeline has matured enough that transcription accuracy on clean English speech is now comparable to professional human transcribers. The remaining engineering challenge is not accuracy on ideal audio but robustness on real-world audio: accented speech, cross-talk, low-bitrate recordings, and domain-specific vocabulary like medical terminology or financial jargon.
The enterprise unlock
When every call, meeting, and interview becomes a structured document, patterns become visible at scale. Which objections appear most often in lost deals? Which meeting types run long without a decision? Which onboarding steps generate the most questions? Audio AI makes these questions answerable without a manual review team.
How Whisper-Class ASR Works
ASR stands for Automatic Speech Recognition. Whisper (released by OpenAI, arXiv:2212.04356) is an ASR model trained on a large corpus of multilingual web audio paired with transcripts. It set a new benchmark for zero-shot multilingual transcription accuracy and became the dominant reference architecture in this class.
Step 1: Raw audio to mel spectrogram. Audio is a waveform: amplitude over time. To give a neural network something it can process, the waveform is converted into a mel spectrogram, a two-dimensional representation of frequency content over time. The horizontal axis is time, the vertical axis is frequency (compressed to the mel scale, which approximates human hearing), and pixel brightness represents energy at that frequency at that moment. Think of it as a visual fingerprint of sound.
Step 2: The encoder. The mel spectrogram is fed into a transformer encoder, which learns to represent the acoustic content of each time segment as a high-dimensional vector. The encoder captures which sounds are present and in what sequence, without yet producing words.
Step 3: The decoder. A transformer decoder takes the encoder's representations and generates a text sequence, one token at a time. It is conditioned on the language token (which language to transcribe in) and can optionally translate directly into English even when the source audio is in another language.
Training data. Whisper was trained on audio scraped from the web paired with corresponding text. The breadth of that data, covering many accents, languages, recording conditions, and domains, is why it generalizes better than models trained only on curated studio recordings. Domain-specific vocabulary remains a weak point and is typically addressed through fine-tuning on in-domain audio or post-processing with a language model that knows the vocabulary.
Fig 1 · Audio-to-Structured-Output Pipeline
Speaker Diarization: Who Said What
Transcription answers "what was said." Diarization answers "who said it." They are distinct problems solved by different models, then combined in the final output.
The diarization problem. Given an audio recording with multiple speakers, segment it into contiguous time intervals and assign each interval a speaker label (Speaker A, Speaker B, and so on). The model does not know in advance how many speakers there are or who they are. It discovers speaker identity from the audio alone.
How it works. Diarization systems extract speaker embeddings, compact numerical representations of a speaker's vocal characteristics, from short audio segments, typically half a second to two seconds long. These embeddings are sometimes called d-vectors or x-vectors depending on the architecture. The system then clusters these embeddings: segments that sound like the same person cluster together. The cluster boundaries define when a speaker change occurred.
Combining transcription and diarization. After running ASR and diarization separately, the two outputs are aligned by timestamp. Each word from the ASR output is assigned to whichever speaker the diarization model assigned to that moment in the audio. The result is a speaker-labeled transcript: Speaker A [00:01:14]: "I think we should move the launch to Q3."
Where diarization fails. Cross-talk, where two people speak simultaneously, is the hardest case. Diarization systems typically assign overlapping speech to one speaker or the other rather than both. Very short speaker turns, under a second, are also unreliable. In enterprise deployments, human review of the diarization output is common for high-stakes use cases like legal depositions or medical consultations.
Mode
Latency
When to use
Example
Real-time
Under 2 seconds
Live captioning, voice assistants, real-time agent assist
Contact center agent sees transcript as caller speaks
Sales manager reviews 50 calls overnight with AI-generated summaries
Real-time transcription uses streaming ASR: audio is processed in short windows (often 100-500ms) and partial results are emitted continuously, with corrections as more context arrives. Batch transcription processes the complete audio file after the event ends, which allows the model to use full bidirectional context and typically produces higher accuracy. For most enterprise analytics use cases, batch is sufficient and significantly cheaper to operate.
Post-Transcript LLM Pipeline
The transcript itself is a lightly structured text document. An LLM turns it into structured intelligence: a summary, a list of action items, key decisions made, sentiment per speaker, open questions, and follow-up owners. The prompt design for meeting analysis follows consistent patterns.
Pattern 1: Role-framed extraction. Tell the LLM its role and the input type before presenting the transcript. "You are analyzing a sales call transcript. Extract all action items with their owner and deadline. Format as JSON."
Pattern 2: Per-speaker analysis. Because the transcript includes speaker labels, you can request sentiment or engagement signals per person. "For each speaker, characterize their overall sentiment as positive, neutral, or negative and list two to three phrases that support your assessment."
Pattern 3: Structured output with a schema. Specifying a JSON schema in the prompt reduces parsing errors and makes downstream pipeline steps simpler. Define the fields: summary (string), action_items (array of {owner, task, deadline}), decisions (array), open_questions (array).
What to watch for. LLMs can hallucinate decisions or action items that were implied but not explicitly stated. The prompt should ask the model to only extract items that were explicitly mentioned, not inferred. A human review step for high-stakes decisions (budget commitments, staffing changes) is a reasonable control.
"We had a great quarter in the Southeast region. Revenue was up and churn dropped significantly."
SPEAKER B · 00:00:12
"Agreed. Should we reallocate some budget to double down on that market before end of quarter?"
SPEAKER A · 00:00:19
"Yes. Let's set up a review session with finance by Friday. I'll send the invite."
SPEAKER C · 00:00:26
"I can pull the regional breakdown before then. Give me until Wednesday."
Python · Whisper API + LLM action item extraction
# Step 1: Transcribe audio with Whisper APIimport openai, json
client = openai.OpenAI()
withopen("sales_call.mp3", "rb") as f:
transcription = client.audio.transcriptions.create(
model="whisper-1",
file=f,
response_format="verbose_json", # includes timestamps
timestamp_granularities=["word"]
)
raw_transcript = transcription.text
# Step 2: Extract structured output via LLM
system_prompt = """You analyze sales call transcripts.
Return a JSON object with these fields:
- summary: string (2-3 sentences)
- action_items: array of {owner, task, deadline}
- decisions: array of strings
- open_questions: array of strings
Only extract items explicitly stated, not implied."""
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "system", "content": system_prompt},
{"role": "user", "content": raw_transcript}
],
response_format={"type": "json_object"}
)
structured = json.loads(response.choices[0].message.content)
print(json.dumps(structured, indent=2))
Latency Tradeoffs in Enterprise Deployments
The choice between streaming and batch transcription is an architectural decision, not a product preference. The right answer depends on where the output is consumed and when.
Real-time streaming is appropriate when the human or system that consumes the transcript needs it during the conversation. Contact center agent assist, live captions for accessibility, and real-time compliance flagging are genuine real-time use cases. Streaming requires a persistent audio connection to the ASR service and substantially higher infrastructure cost per hour of audio.
Batch processing covers the majority of enterprise audio analytics use cases. A call recorded at 2pm does not need its transcript until the manager reviews it the next morning. Running batch jobs on completed recordings is cheaper, more accurate, and easier to scale. Most organizations start with batch and add real-time capability only for specific workflows that require it.
A practical split. Run real-time transcription for agent-facing use cases where the agent needs live guidance. Run batch transcription for all QA, coaching, analytics, and compliance review workflows. This split reduces infrastructure cost substantially while covering both use cases.
Think about it first: a legal firm wants to transcribe client consultations for compliance records. Real-time or batch? Why?+
Batch. The compliance record does not need to exist during the consultation; it needs to exist and be accurate after it. Batch transcription gives higher accuracy (full bidirectional context), is significantly cheaper to run at scale, and allows a human review step before the transcript is stored. Real-time transcription would add cost and complexity without a corresponding operational benefit for this use case. The only scenario where real-time might be appropriate here is live captioning for accessibility, which is a separate requirement from compliance record-keeping.
What is the primary purpose of converting raw audio to a mel spectrogram before feeding it into an ASR model?
Speaker diarization and ASR are typically run as separate processes. What does diarization add to a plain ASR transcript?
A contact center wants to show live suggestions to agents while a customer is speaking. Which transcription mode is required?
Before you go
Whisper-class ASR converts raw audio to a mel spectrogram, runs it through an encoder-decoder transformer, and outputs text. Training breadth across accents and languages is the core reason for its generalization.
Speaker diarization uses speaker embeddings clustered over time to answer "who spoke when." It runs separately from ASR and is aligned with the transcript by timestamp.
Post-transcript LLM pipelines extract structured intelligence from the labeled transcript. Prompt design patterns: role framing, per-speaker analysis, and explicit JSON schema output with a strict "only extract what was said" instruction.
Reflection: think of one business process in your organization that generates audio that is currently unanalyzed. What structured outputs would be most valuable, and who would act on them?
Share this insight: "Your recorded calls are dark data. Audio AI turns a 1-hour recording into a searchable transcript with speaker labels, action items, and sentiment in seconds. Free course module at arjunjaggi.com/course/multimodal-ai/"