11.2 Audio and Speech Integration
Speech carries words, timing, speaker characteristics, prosody, and background sound. A transcript is a useful representation, but a text-only interface usually discards information not explicitly represented in it. A cascade can retain timestamps, speaker labels, or separate acoustic features; transcription does not force every system to discard all paralinguistic information.
The engineering choice is where to compress the signal and where to preserve temporal structure. A native audio interface can reduce some handoff costs, while introducing streaming, alignment, and interruption problems of its own.
1. Waveforms, Frames, and Token Rate
A mono waveform sampled at 16 kHz contains 16,000 samples per second; its stored dtype is a separate choice. An encoder converts it into lower-rate frames. A neural codec can then map each frame to discrete indices. Sound frame rate and serialized token rate are different quantities.
With frames per second and codebooks, naive serial prediction uses token decisions per second. If each index has possibilities, the ideal fixed-rate index payload is bits/s, excluding framing and entropy coding. At , , and , this is 400 indices/s and 4,000 bits/s. A delayed or parallel multi-codebook schedule changes serial steps without changing this nominal payload.
Why does Whisper hear 30 seconds in an 11-second recording?
OpenAI tests Whisper with an excerpt from John F. Kennedy’s inaugural address. The file contains 11 seconds of stereo audio at 44,100 Hz. Keep the checkpoint and decoder fixed. On the first pass, ask FFmpeg to mix the channels to mono and resample to 16,000 Hz, the rate Whisper expects. On the second, mix to mono at the original rate and pass the samples to the same feature extractor with sampling_rate=16000. That argument tells the extractor how to interpret the array. It cannot recover the source rate from the samples. [18] [19]
| Measured on the same clip | Resampled to 16 kHz | 44.1 kHz labeled as 16 kHz |
|---|---|---|
| Samples before padding or trimming | 176,000 | 485,100 |
| Duration implied by the declared rate | 11 s | 30.31875 s |
| Samples added or removed to fill one 30 s window | 304,000 added | 5,100 removed |
| Mel frames marked valid in the attention mask | 1,100 of 3,000 | 3,000 of 3,000 |
| First five decoded words | “And so my fellow Americans” | “Ah, oh, oh, oh, oh,” |
| Words in the output (split on whitespace) | 22 | 32 |
| Phrases found from the three in OpenAI’s test | 3 of 3 | 0 of 3 |
Both feature tensors have shape [1, 80, 3000]. The wrong rate stretches the apparent duration by . The extractor then discards the final 5,100 samples to fit the single window. Its mask correctly reports which frames came from the supplied waveform. It has no way to tell whether a second of that waveform contains the right number of samples.
When a transcription service accepts a new recording format, check the unpadded sample count immediately after resampling. For this file, len(mono_16k) / 16000 should agree with the 11 seconds independently reported by ffprobe. The three phrase checks catch the effect on this recording. Measuring a speech recognizer’s word error rate requires reference transcripts across the target recordings.
Reproduce the CPU run (2026-11-25). The script downloads and checksums the upstream recording and the English-only openai/whisper-tiny.en weights. Both passes use FP32, one CPU thread, the same attention mask convention and greedy decoding without timestamps, capped at 64 new tokens. The JSON records short excerpts and hashes of the full decodes. Pass --show-transcripts to inspect the full text locally. Python script and setup commands · Measured results (JSON).
Hear what a sample-rate error sounds like
Both WAV files contain the same 44,100 samples from two synthesized notes. The rate in each file’s header tells the player how many samples to read per second.
- Original rate of 44,100 Hz 441 Hz then 882 Hz · 1 s total Download WAV
- Mislabeled rate of 16,000 Hz 160 Hz then 320 Hz · about 2.76 s total Download WAV
Save both WAVs in one directory and run this check there. It calculates each duration from the header and compares the audio samples byte for byte.
import wave
payloads = []
for name in ("sample-clock-44100.wav", "sample-clock-16000.wav"):
with wave.open(name, "rb") as wav:
frames = wav.getnframes()
print(wav.getframerate(), frames, frames / wav.getframerate())
payloads.append(wav.readframes(frames))
assert payloads[0] == payloads[1]
Share the listening experiment as a short article.
2. Residual Vector Quantization
For encoded frame , initialize residual . At stage , codebook has vectors of dimension :
Here is the selected index and the reconstructed feature frame. Later stages model residual error; they are not guaranteed to represent a particular semantic category. Decreasing residual norm also depends on the available codebook vectors and training, not simply on adding arbitrary random codebooks.
Educational forward-pass example: This is an untrained nearest-codebook lookup, not a trained speech codec or a smoke-tested training pipeline. It omits the waveform encoder/decoder, commitment loss, straight-through or EMA learning, dead-code management, variable-length masks, distributed synchronization, and mixed-precision stability. Its random-feature output demonstrates tensor shapes only; it does not demonstrate intelligible audio or reconstruction quality.
import torch
import torch.nn as nn
class ResidualVectorQuantizer(nn.Module):
def __init__(self, num_quantizers=8, codebook_size=1024, dim=128):
"""
Args:
num_quantizers: Number of cascaded codebooks (Q)
codebook_size: Number of vectors per codebook (N)
dim: Dimension of each vector (d)
"""
super().__init__()
self.num_quantizers = num_quantizers
self.codebooks = nn.ParameterList([
nn.Parameter(torch.randn(codebook_size, dim))
for _ in range(num_quantizers)
])
def forward(self, x):
# x shape: [batch_size, seq_len, dim]
residual = x
quantized_out = torch.zeros_like(x)
token_indices = []
for i in range(self.num_quantizers):
codebook = self.codebooks[i]
# Compute squared L2 distance: x^2 + y^2 - 2xy
# residual^2: [batch, seq, 1]
# codebook^2: [codebook_size]
# matmul: [batch, seq, codebook_size]
dist = (
residual.pow(2).sum(dim=-1, keepdim=True)
+ codebook.pow(2).sum(dim=-1)
- 2 * torch.matmul(residual, codebook.t())
)
# Find index of the closest codebook vector
indices = torch.argmin(dist, dim=-1) # [batch_size, seq_len]
token_indices.append(indices)
# Lookup quantized vectors and accumulate
quantized = codebook[indices]
quantized_out += quantized
# Update residual for the next quantizer stage
residual = residual - quantized
# token_indices shape: [batch_size, num_quantizers, seq_len]
return quantized_out, torch.stack(token_indices, dim=1)
# Example execution simulating a 50Hz audio frame rate
batch_size = 2
seq_len = 50 # 1 second of audio
dim = 128
dummy_audio_features = torch.randn(batch_size, seq_len, dim)
rvq = ResidualVectorQuantizer(num_quantizers=8, codebook_size=1024, dim=128)
reconstructed, indices = rvq(dummy_audio_features)
print(f"Original features: {dummy_audio_features.shape}")
print(f"Reconstructed features: {reconstructed.shape}")
print(f"Token indices shape: {indices.shape}")
# Output: -> 8 tokens per frame
3. Discrete and Continuous Audio Modeling
AudioLM separates semantic and acoustic representations in a hierarchy [1]. VALL-E studies codec language modeling conditioned on text and a speaker prompt [2]. AudioPaLM combines text and speech representations to support speech tasks [3]. These mechanisms differ; an audio-capable product name alone does not disclose which one a provider uses.
CALM studies autoregressive continuous audio latents with a consistency-based next-frame generator [4]. Removing discrete quantization does not make the VAE lossless or eliminate every source of error. Compare fidelity, intelligibility, temporal stability, latency, and compute at matched task and hardware conditions rather than declaring continuous models universally preferable.
Text tokenization is deterministic for a fixed tokenizer and full input, but a word can tokenize differently with whitespace or surrounding text. Acoustic token variation likewise depends on the waveform and encoder context. Neither observation alone proves that one representation is context-free or that discrete prediction must fail.
4. October API Case: Voice Identity and Action Timing Are Separate Contracts
As of 2026-10-18, OpenAI’s October 16 API update adds prompt-generated voices and nine natural voices for GPT-Live. The October 15 update adds native Decisions integration, enabling decisions while input or output transcript deltas arrive [5] [6]. These are documented API capabilities; they do not reveal the model’s codec, parameter count, or training mixture.
The engineering implication is to version the voice identity, audio session, and action policy separately. A transcript prefix can be revised, interrupted, or canceled. For “transfer fifty—actually fifteen,” an early decision must not become an irreversible transfer before the amount and authorization are settled. Use provisional decisions, cancellation identifiers, duplicate suppression, and independent execution checks. A changed voice must not change the action’s permission boundary.
As of 2026-10-25, the October 22 changelog marks Decisions with GPT-6 Luna generally available, including up to 400 questions per request, prompt caching and JSON input [5]. Native voice integration is a capability contract, not a guarantee that acting on a partial transcript is safe. Evaluate transcript revisions, duplicate triggers, decision latency and authorization; see Section 16.7.
Voxtral 3: Keep Speech Models and Agent Orchestration Separate
As of 2026-10-25, Mistral’s October 20 changelog lists four Voxtral 3 models in public API preview: Mini TTS, Mini Transcribe, Mini Transcribe Realtime, and Small Transcribe. It also introduces a Voice Agents SDK/pipeline [7]. The release offers self-deployment, which does not by itself establish a publicly downloadable open-weight checkpoint [8].
Treat these as different contracts: offline transcription, streaming transcription, speech synthesis, and an orchestrated agent are not interchangeable benchmarks. The TTS card and launch page describe different language coverage, so verify the exact SKU and endpoint before promising support [8] [9]. Evaluate WER/CER and diarization for transcription, pronunciation and first-audio latency for TTS, and turn-taking, interruptions, transcript corrections, tool authorization and cost per completed task for the complete voice agent. Provider launch charts are not a matched end-to-end comparison of those systems.
5. November Voice Releases: Conversation and Work Have Separate Lifecycles
As of 2026-11-24. GPT-Live-1.1, released on November 19, and Qwen-Audio-3.1-Live, released on November 23, are released/API-only voice services in the cited documentation; these releases do not establish downloadable weights. Both let a voice conversation continue around delegated work. That is an interface capability, not disclosure of their codec, parameter count, or training mixture. [5] [10] [12] [13]
| Service | Documented contract | What to validate |
|---|---|---|
| GPT-Live-1.1 | Text/audio input and output; OpenAI reports improved multilingual transcription and accent consistency. WebRTC standby pauses inference during inactivity and resumes on speech. [10] [11] | Pronunciation and transcription by language; first response after waking; distinction between stopped playback and unfinished backend work |
| Qwen-Audio-3.1-Live | Full-duplex text/audio; Client mode delegates to the application, while Responses mode invokes a selected backend model. Voice-session time, including silence, and backend token usage are billed separately. [13] | Task/result identifiers, corrected requests, delayed results and total conversation cost |
Consider “check stock for the blue umbrella—actually, the black one.” Give each task a version and retain the latest confirmed request. A result for the blue umbrella must not become a confident spoken answer about the black one. Cancel obsolete work where supported, suppress stale results, and make side-effecting tools check current arguments, authorization and idempotency. OpenAI explicitly notes that steering the voice frontend does not cancel an already running backend task. Qwen’s guide likewise separates delegation identifiers from individual function-call identifiers. [14] [15]
Standby is also different from ending a session or canceling a task. Record inference pause/resume events, audio actually played, task creation/cancellation/completion and user corrections on one timeline. Measure stale-result announcements and actions after cancellation as failures, even when the speech sounds natural.
6. Streaming Evaluation and Practical Takeaway
When do you know who said it?
A meeting caption can have the right words before it has the right speaker. As of 2026-11-25, ElevenLabs offers Scribe v3 Live through its hosted transcription API. With diarize=true, each commit fixes a segment’s text while a later event supplies speaker labels for its words. The following example follows one segment in one session using the published event definitions. [16] [17]
| Event | What the meeting app does |
|---|---|
partial_transcript | Show “Use the north” as a draft. A later partial replaces it. A word’s draft speaker ID can be null or change. [17] |
committed_transcript | Save “Use the north door.” once for segment_index=7. Display the settled text immediately. [17] |
diarized_transcript | Match index 7 and attach the supplied speaker labels. In this example the words are assigned to speaker_2. A word can still have an unresolved speaker. [17] |
speakers_merged | If the event maps speaker_2 to speaker_0, update earlier uses of that label in the session. Apply chained merges in receive order. [17] |
After those four messages, segment 7 contributes one sentence to the meeting notes, attributed to speaker_0. Appending the diarized text as another utterance would duplicate it. Measure how soon the words appear and how soon the speaker labels arrive as separate latencies. [17]
Measure time to first audible output, inter-chunk gaps, end-to-end response latency, interruption detection and stop time, transcript revision stability, tool-action correctness, and cost per completed conversation. Evaluate noisy speech, accents, code-switching, overlapping speakers, silence, and disconnect/reconnect. Use intelligibility and human listening checks alongside word error rate; a correct transcript can still produce a poor spoken interaction.
Retain an immutable bundle of model/endpoint revision, codec or audio preprocessing where exposed, sample rate/channel conventions, voice ID, template, generation settings, tool schema, and safety/action policy. Keep test audio and speakers isolated from adaptation data. Canary a new voice or streaming configuration against the same conversations, gate on critical action errors and supported-language slices, and rehearse rollback of both session state and pending actions.
Audio integration is a joint representation and state-management problem. The following section generalizes those issues to multiple modalities without assuming a single shared encoder or unrestricted output generation.
Quizzes
Quiz 1: Why are 50 frames/s and 400 codec indices/s compatible?
Eight codebooks can produce eight indices per frame. Serial decision count depends additionally on the prediction schedule.
Quiz 2: Whisper produces 3,000 Mel frames from both versions of an 11-second clip. What would you check before changing the model?
Probe the recording’s rate and duration, then count the mono samples before padding. At 16 kHz, 11 seconds should yield 176,000 samples. Both inputs fill the same feature window, but only the correctly resampled one has 1,100 valid frames.
Quiz 3: Does replacing discrete tokens with continuous latents make audio generation lossless?
No. Latent compression and generation still introduce error. Validate the full waveform output, not only the absence of quantization.
Quiz 4: For segment 7 you have committed text, but a later word still has a null speaker ID. What belongs in the meeting notes?
Keep one copy of the committed text and leave the unresolved word unattributed. Attach speaker updates to that segment. A speaker merge can revise earlier attribution without adding another utterance.
Quiz 5: Does compressing audio tokens directly compress the transformer’s KV tensors by the same factor?
No. Codec bitrate determines the input representation; KV storage depends on retained positions, KV heads, dimensions, layers, dtype, and cache policy. They are distinct budgets.
Quiz 6: Why is a voice interruption insufficient evidence that a delegated task was canceled?
Playback, frontend inference and backend work have separate lifecycles. Confirm cancellation or completion in the task system, suppress outdated results, and revalidate the current request before an action or spoken result.
References
- Borsos, Z., et al. (2022). AudioLM: a Language Modeling Approach to Audio Generation. Paper.
- Wang, C., et al. (2023). Neural Codec Language Models are Zero-Shot Text to Speech Synthesizers (VALL-E). Paper.
- Rubenstein, P. K., et al. (2023). AudioPaLM: A Large Language Model That Can Speak and Listen. Paper.
- Rouard, S., et al. (2025). Continuous Audio Language Models. Paper.
- OpenAI. (2026). API changelog: October voice/Decisions updates and November 19 GPT-Live-1.1 release. Verified 2026-11-24. Official documentation.
- OpenAI. (2026). Connect voice to Decisions. As of 2026-10-18. Official documentation.
- Mistral. Changelog: October 20 Voxtral 3 and Voice Agents preview. Verified 2026-10-25. Documentation.
- Mistral. (2026-10-20). Voxtral 3. Release.
- Mistral. Voxtral TTS 3 model/API card. Verified 2026-10-25. Card.
- OpenAI. GPT-Live-1.1 model documentation. Verified 2026-11-24. Model.
- OpenAI. Managing GPT-Live sessions: idle sessions. Verified 2026-11-24. Guide.
- QwenCloud. Model releases: November 23, 2026. Verified 2026-11-24. Changelog.
- QwenCloud. qwen-audio-3.1-live. Verified 2026-11-24. Model.
- OpenAI. Delegation and tools in GPT-Live. Verified 2026-11-24. Guide.
- QwenCloud. Qwen-Audio-Live: task delegation and tools. Verified 2026-11-24. Guide.
- ElevenLabs (2026-11-10). Scribe v3 and Scribe v3 Live release.
- ElevenLabs. Realtime transcription event reference, including speaker attribution and merges.
- OpenAI. English-only Whisper Tiny model card and reference audio loader.
- OpenAI. Whisper transcription regression test and its phrase checks and the upstream JFK recording.