Accent, Noise SNR & 8kHz Telephony
Voice & Conversational Audio AI Agents Testing β Day 2
Synthesize 16-bit PCM WAV fixtures with Python stdlib wave/struct, calculate Signal-to-Noise Ratio (dB), simulate 8kHz PSTN narrowband audio, and gate accent disparity curves.
Studio-clean 16kHz audio tests give false confidence. Real callers dial over 8kHz PSTN lines from noisy vehicles and represent diverse regional accents. Today you will synthesize 16-bit PCM WAV streams, compute SNR in decibels, downsample to 8kHz telephony narrowband, and enforce accent disparity SLOs.
The official reference codebase for Day 2 is hosted in the repository. Clone the repository and navigate to day-2-accent-noise-snr/test_day2.py to run the working solution.
git clone https://github.com/777abhi/voice-ai-testing-roadmap.git
cd voice-ai-testing-roadmap/day-2-accent-noise-snr/test_day2.pySynthesize PCM Audio & Gate Accent/Noise Curves
Run the Day 2 audio synthesis, SNR, and accent disparity test suite.
npm run test:day2speech = generate_speech_envelope_pcm(1.0, sample_rate=16000, amplitude=0.6)
noise = generate_white_noise_pcm(1.0, sample_rate=16000, amplitude=0.04, seed=42)
snr_db = compute_snr_db(speech, noise)
tel_8k = downsample_to_telephony_8khz(speech, orig_rate=16000)
report = evaluate_degradation_curve(profiles, max_wer_at_10db=0.12, max_accent_gap=0.05)- Generated deterministic 16-bit PCM WAV files using only Python stdlib wave and struct.
- Measured Signal-to-Noise Ratio (dB) and simulated 8kHz PSTN narrowband downsampling.
- Enforced monotonic noise degradation and bounded WER disparity across regional accent cohorts.
π§ Knowledge Check
Why must voice AI quality gates evaluate WER degradation across 8kHz narrowband audio and multiple accent cohorts?