Voice AI Audio Compatibility: A 12-Case Phone/Web Acceptance Test
说明与用途
12 个用例的验收套件验证电话、浏览器和 AI 语音模型之间传输的音频是否符合声明的媒体合同,防止隐藏转换和编解码错误。
问题
Ensuring that audio data exchanged between phone, browser, and AI voice model conforms to the exact media contract to avoid subtle audio defects.
结果
The 12‑case acceptance suite detects contract mistakes before voice model evaluation, preventing audio defects such as wrong sample rates, codec mismatches, or hidden conversions.
工作流
- 1. Define a contract row for each boundary (e.g., Phone provider → adapter, Adapter → speech model, etc.).
- 2. Record the expected metadata (codec, sample rate, channels, framing, envelope) for each boundary.
- 3. Capture the actual payload at each boundary using packet capture or stream inspection.
- 4. Validate that the captured payload matches the declared metadata (e.g., Base64‑decoded μ‑law samples at 8 kHz).
- 5. Verify that any conversion (e.g., μ‑law to linear PCM, resampling) is explicit and documented.
- 6. Ensure the outbound payload to the phone playback matches the provider’s required envelope and raw audio bytes.
- 7. Record and label any recordings or observability sinks with container, codec, rate, channels, and timestamp origin.
- 8. Release the integration only when all boundaries meet the contract and no implicit conversions are detected.
证据
A sample rate is not a codec, a codec is not a container, and metadata is not a conversion.
For a Twilio bidirectional Media Stream, the contract is explicit: the start.mediaFormat reports audio/x-mulaw, 8,000 Hz, one channel; outbound audio is raw μ-law at 8,000 Hz, Base64 inside a text JSON WebSocket message, with no audio-file header.
The public information baseline is already strong on individual formats. Twilio documents its message envelope and raw outbound μ-law payload. MDN describes WebRTC codec options. SignalWire documents its own stream choices, including PCMU, A-law and linear PCM options, and distinguishes phone streams from browser WebRTC.
- 记录日期: 2026-10-25T14:26:09.240Z