📝 Originally published (in Japanese) at forge.workstyle.tech.
Quality Control for TTS Models: Why Transcription Isn’t Enough
I used to perform quality control (QC) for TTS models using this process:
- Have the model read probe sentences
- Transcribe with Whisper
- Compare against the script to check accuracy and trailing elongation
- Analyze the waveform for utterance duration, sound pressure, and F0 to detect abnormalities
I created 12 voices and passed all of them through this QC. Whisper got 4/4 accuracy, no trailing elongation, and sound pressure was within normal range. I reported 100% pass rate.
Later, when I rechecked from a different angle, 4 of them still had defects. These were invisible to STT-based inspection due to fundamental limitations.
STT Drops Short Sounds
The first clue came when I received this report:
ご覧ください。 Total: 1.61s Body: 0.88s → Silence: 0.48s → 【0.16s utterance】
こちらです。 Total: 1.65s Body: 0.72s → Silence: 0.56s → 【0.28s utterance】
After finishing the script, there’s a full 0.5-second silence followed by a 0.1–0.3 second utterance. This isn’t trailing resonance—the model is producing sounds not in the script (the root cause was training corpus contamination: “3 characters” allowed by the quality gate became verbal tics).
The reason my initial inspection missed this is simple: Whisper dropped these sounds.
ご覧ください。 → STT: "ご覧くださいああ" ← barely caught
こちらです。 → STT: "こちらです" ← completely dropped
A 0.28-second utterance doesn’t appear in the transcription at all. Short sounds that aren’t meaningful words may not appear in STT output. As long as you’re only looking at transcriptions, this defect doesn’t exist.
I even concluded, “STT got 0/6, so no extra sounds,” mistaking the blind spot of my measurement method for a property of the target.
Seeing Through Waveform Envelope
What’s actually being output appears in the waveform. By extracting voiced blocks from the RMS envelope and examining their sequence, we can detect these artifacts.
def segments(wav_bytes, thr_ratio=0.06):
"""Returns [(start_sec, end_sec), ...] of voiced blocks"""
w = wave.open(io.BytesIO(wav_bytes)); sr = w.getframerate()
x = np.frombuffer(w.readframes(w.getnframes()), dtype=np.int16) / 32768
W, H = int(sr * 0.020), int(sr * 0.010) # 20ms window / 10ms hop
rms = np.array([np.sqrt(np.mean(x[i*H:i*H+W]**2))
for i in range(max(0, (len(x)-W)//H))])
# Use the larger of relative or absolute threshold
act = rms > max(rms.max() * thr_ratio, 0.004)
segs, s = [], None
for i, a in enumerate(act):
if a and s is None:
s = i
elif not a and s is not None:
if (i - s) * 0.010 >= 0.03: # Ignore blocks <30ms
segs.append((s * 0.010, i * 0.010))
s = None
if s is not None:
segs.append((s * 0.010, len(act) * 0.010))
return segs
Why Double Thresholds Matter
The max(rms.max() * 0.06, 0.004) part is subtly critical.
Relative threshold alone fails for low-volume voices. If the overall volume is quiet, the maximum value is small, causing noise floor to be misclassified as voiced.
Absolute threshold alone fails for high-volume voices. Breathing or lip smacks get classified as voiced.
The 12 voices had sound pressure ranging from −13.3 to −18.8 dB, so neither threshold alone could work across all voices.
Discarding blocks under 30ms is also necessary. Without this, lip noise or quantization noise appears as many tiny blocks, breaking downstream logic.
Detection Criteria
Once voiced blocks are extracted, we check: “Is there sufficient silence before the final block, and does that block have sufficient duration?”
GAP_MIN = 0.25 # Silence this long or more indicates a separate utterance
TAIL_MIN = 0.06 # Duration this long or more indicates an artifact
def has_trailing_artifact(wav):
segs = segments(wav)
if len(segs) < 2:
return None # No artifact if only one block
gap = segs[-1][0] - segs[-2][1] # Silence before last block
tail = segs[-1][1] - segs[-1][0] # Duration of last block
if gap >= GAP_MIN and tail >= TAIL_MIN:
return (gap, tail)
return None
GAP_MIN=0.25 separates natural trailing resonance or pauses from clearly separated utterances. Measured artifacts had silence gaps of 0.26–0.91 seconds, so 0.25 is sufficient.
TAIL_MIN=0.06 avoids catching fade-out tails. Measured artifacts were 0.07–0.36 seconds long.
Commas Caused False Positives in All 12 Models
In my first scan, all 12 models triggered the detector. The probe sentence contained this:
では、始めます。
Block[0] = "では"
Block[1] = "始めます" ← 0.40s silence followed by 0.75s duration
This was a pause after a comma. After “では、” there’s a gap, then “始めます。” follows. The final block is part of the script itself, yet it perfectly matches the detection condition (gap + subsequent utterance).
The condition “there’s utterance after the final gap” will always produce false positives for sentences containing commas. That’s because it doesn’t consider script structure.
There are two fixes:
Limit probes to single sentences. If you exclude sentences with commas, any utterance after the body can be definitively identified as an artifact. This is what I adopted—simple implementation and no dependency on the script.
Align with script end position. Derive the script end position from Whisper segments and check if energy exists beyond that point. This is more general but reintroduces STT dependency. If artifacts don’t appear in Whisper segments, the end position might be incorrectly determined.
After removing false positives:
Before (with commas): 29 / 72 detections ← all 12 models triggered
After (single sentences only): 16 / 72 detections ← only 4 models triggered
| Model | Artifacts |
|---|---|
| Male Narrator | 6/6 |
| Female Operator | 4/6 |
| Female Presenter | 4/6 |
| Male Presenter | 2/6 |
| Remaining 8 | 0/6 |
Had I reported the initial results as-is, I would have spread false panic of “all 12 failed.” Once you build a detector, you must first test it on things that should not trigger it.
Be Aware of Inspection Layers
What I learned is that audio quality inspection requires multiple methods that reveal different layers:
| Method | Reveals | Misses |
|---|---|---|
| STT (transcription) | Word omissions, substitutions, large insertions | Short artifacts, silence structure, audio quality |
| Waveform envelope | Utterance boundaries, silence, artifacts | What it’s saying |
| Acoustic features (F0, sound pressure, intonation) | Pitch, volume, variation | Correctness of content |
| Listening test | Everything (but subjective & not scalable) | — |
Relying only on STT for QC meant assuming everything visible in the most familiar tool would be visible everywhere. In reality, STT only shows “what can be recognized as words.”
Interestingly, these 4-second artifacts are hard to notice even when listening. A 0.1-second sound feels like “some lingering resonance” unless you’re paying close attention. Only by laying out the numbers do you realize there’s an abnormal structure: “silence 0.5s followed by sound.”
If humans can’t perceive it subjectively, machines must measure it. And every measurement method has its own blind spots.
Steps for Building a Detector
Reflecting on this experience, here’s the process I should have followed:
- Secure real examples of the defect first. Having concrete cases like “short utterances separated by silence” let me define correct detection targets
- Prepare examples that must not trigger the detector. Sentences with commas, natural pauses, silence endings. Had I prepared these first, I’d have spotted false positives immediately
- Set thresholds based on real data distribution. Measured artifacts had silence 0.26–0.91s and duration 0.07–0.36s, so I set 0.25 and 0.06. Don’t start with round numbers
- Run against all targets and examine the distribution. “12/12 models triggered” isn’t success—it’s a sign of abnormality. If everything triggers, suspect the detector, not the targets
The fourth point is the key lesson: when detection rates are too high, suspect the detector, not the targets.
Series: Mass-producing Practical Voices from Diffusion TTS
A record of designing voices from single captions, manufacturing training corpora, and mass-producing role-specific practical voices. This article is Part 3: Quality Gate.
← Previous: Weeding out candidates using fixable defects
→ Next: How 70 minutes of training material vanished in an instant due to a network blink
Full series (18 parts)
- TTS Chosen for Audio Quality Was Too Slow for Conversation
- Rolling the Dice for Voices
- “Narrator-like Voice” Selected by Machine from 24 Candidates
- The Stricter the Quality Gate, the More Flat Takes Survive
- You Can’t Change Speaking Rate After Training
- TTS That Changes “Recording Room” Every Time It Generates
- Roughness in One Clip Ruins the Entire Style
- Why AI Elongates “Konnichiwa” — Where Did the Habit Come From?
- “Soshō” Becomes “Shomo” — How an Approved Character List Was Truncating Japanese
- Hallucination Guard Code That Never Fired… Except During Hallucinations
- How “3 Characters” Approved by the Quality Gate Became Verbal Tics
-
Weeding Out Candidates Using Fixable Defects
13. Some Defects Are Invisible to Transcription ← You are here - How 70 minutes of training material vanished in an instant due to a network blink
- From “ja” to “JP”: How a babbling model emerged
- Four registration paths, zero admin screens
- Deploying would erase each other’s work every time
- Pushing unmeasurable traits with thresholds always fails
The insights in this article are compiled in the Diffusion TTS Manufacturing Pipeline for Mass-producing Practical Voices.