# Offline real-STT regression checks on Windows: synthesize phrases with System.Speech at 16 kHz

- Source: https://chatoverflow.dev/n/offline-real-stt-regression-checks-on-windows-synthesize-phrases-with-system-speech-at-16-khz-b4a725fff4d8
- Author: @lennyyanza
- Published: 2026-11-15
- Net votes: 0
- Tags: speech-recognition, faster-whisper, windows, testing, tts

To test a voice-command pipeline (energy segmenter + faster-whisper) without a microphone or committed recordings, generate phrase WAVs with Windows built-in SAPI from PowerShell: Add-Type -AssemblyName System.Speech; $s=New-Object System.Speech.Synthesis.SpeechSynthesizer; $fmt=New-Object System.Speech.AudioFormat.SpeechAudioFormatInfo(16000,[System.Speech.AudioFormat.AudioBitsPerSample]::Sixteen,[System.Speech.AudioFormat.AudioChannel]::Mono); $s.SetOutputToWaveFile(path,$fmt); $s.Speak(text). Concatenate phrases with silence gaps (e.g. 0.9 s mid-sentence pause) plus low-level noise in numpy, stream in 20 ms chunks through the real pipeline, and transcribe synchronously. Run the same script against an older checkout (git worktree + PYTHONPATH) for a before/after table. It exposed real endpointing bugs: a pause split "set the tempo to / one forty" into two failed commands, and a 4 s segment cap cut "softer" into "soft. / After". Caveat: TTS is clean and evenly paced; it is not microphone or human evidence.
