silero tts developer on retainer: silero-models v2→v3 upgrade — v3 output 24000 Hz — soundfile.write(samplerate=16000) hardcoded from v2 era — audio 1.5× too slow — pitch −7.0 semitones — $110,000 — 4 months — silero tts developer on monthly retainer
silero-models v3 (Silero AI) • PyTorch 1.11.0 • Python 3.9; upgraded from silero-models v2.3 (v2_3_ru, 16000 Hz) to v3 (v3_1_ru, 24000 Hz); delivery module uses soundfile.write(output_path, audio.numpy(), 16000) hardcoded from v2 era; 24000 Hz PCM data written with 16000 Hz header; playback at 16000 samples/sec; audio 1.5× too slow; pitch −7.0 semitones (12 × log⊂2;(16000/24000)); duration 1.5× of correct • Southfield Silero Voice Ltd. (4-person Russian voice assistant startup; 4 months; 1.5h)
Southfield Silero Voice Ltd. is a 4-person startup building a TTS backend for a Russian-language smart home device. Their original pipeline used silero-models v2.3 (v2_3_ru), which produces Russian TTS audio at 16000 Hz. After Silero released v3 models offering higher naturalness and cleaner consonant synthesis, the team upgraded their torch.hub model loading to speaker=’v3_1_ru’. The silero-models v3 family produces audio at 24000 Hz — a change introduced to improve acoustic quality, particularly in fricative and plosive regions of Russian speech. The smart home IoT platform the company deployed to used audio delivery code that had been written and tested during the v2 era and contained a hardcoded soundfile.write(output_path, audio.numpy(), 16000). This code was not flagged during the v3 upgrade review because the upgrade appeared to work — model.apply_tts() returned a tensor without error, and the WAV file was written successfully. The pitch and speed issue was only discovered when users began reporting voice quality problems.
# tts_service.py — Southfield Silero Voice Ltd. production pipeline
# silero-models v3; PyTorch 1.11.0; Python 3.9; soundfile 0.10.3
import torch
import soundfile as sf
import numpy as np
# v3_1_ru model: model.sample_rate = 24000
model, example_text = torch.hub.load(
repo_or_dir='snakers4/silero-models',
model='silero_tts',
language='ru',
speaker='v3_1_ru' # upgraded from 'v2_3_ru'
)
model.eval()
# model.sample_rate = 24000 ← new in v3; was 16000 in v2.3
HARDCODED_SAMPLE_RATE = 16000 # Bug: leftover from v2.3 era; never updated after v3 upgrade
def synthesize(text: str, speaker: str, output_path: str) -> None:
audio = model.apply_tts(
texts=[text],
sample_rate=HARDCODED_SAMPLE_RATE, # Bug: passed to apply_tts as 16000
speaker=speaker,
put_accent=True,
put_yo=True
)
# audio: torch.Tensor, shape [N] where N = num_samples at 24000 Hz
# Note: Silero v3 apply_tts() ignores the sample_rate kwarg for synthesis rate;
# it always synthesizes at model.sample_rate (24000 Hz).
# The sample_rate kwarg in apply_tts does NOT resample the output.
sf.write(output_path, audio.numpy(), HARDCODED_SAMPLE_RATE)
# WAV header written: samplerate = 16000
# PCM data: 24000 samples per second of speech
# IoT device plays back at 16000 samples/sec:
# 24000 samples (1 second of speech) consumed in 24000/16000 = 1.5 seconds
# Speech plays at 0.667× speed (50% too slow)
# Pitch: 12 × log2(16000/24000) = 12 × (−0.585) = −7.0 semitones
# User hears: deep, slow voice (perceived as 'robotic' or 'demonic')
There is a subtle additional confusion in this bug. The sample_rate parameter in Silero’s apply_tts() method does not control the synthesis sample rate — it is used only for resampling of the input waveform in speaker-conditioned synthesis modes, not for the output. The model always synthesizes at model.sample_rate (24000 Hz for v3). Passing sample_rate=16000 to apply_tts() does not cause the model to output 16000 Hz audio — it still outputs 24000 Hz. The returned tensor contains 24000 PCM samples per speech-second regardless of what integer was passed. This means the bug has two dimensions: (1) the wrong sample rate was passed to soundfile.write() in the WAV header, and (2) the engineer who passed sample_rate=16000 to apply_tts() may have believed this would cause the model to output at 16000 Hz, which it did not. When the engineer checked that apply_tts() returned a valid tensor, the lack of a resampling error confirmed their (incorrect) assumption that 16000 Hz output was being produced.
How the v2→v3 sample rate change produces slow and low-pitched audio
# Sample rate mismatch arithmetic — Southfield Silero Voice Ltd.
#
# silero-models v2.3 (v2_3_ru):
# model.sample_rate = 16000
# soundfile.write(path, audio, 16000) ← correct; audio is 16000 Hz
#
# silero-models v3 (v3_1_ru):
# model.sample_rate = 24000
# soundfile.write(path, audio, 16000) ← Bug: audio is 24000 Hz, header says 16000
#
# Example: Russian phrase "Включи свет" ("Turn on the light"), speaker='baya'
# Natural speech duration: 0.9 seconds
# Synthesis output at 24000 Hz: N = 0.9 × 24000 = 21,600 samples
# WAV file header: samplerate = 16000
#
# IoT device reads WAV header:
# samplerate = 16000 → consume 16000 samples per second of wall time
# 21,600 samples ÷ 16000 samples/sec = 1.35 seconds of playback
# Speech content is 0.9 seconds compressed into 1.35 seconds
# Speed ratio: 0.9 / 1.35 = 0.667× (too slow by factor 1.5)
#
# Pitch shift formula:
# Δf = 12 × log2(claimed_rate / actual_rate)
# = 12 × log2(16000 / 24000)
# = 12 × log2(0.6667)
# = 12 × (−0.5850)
# = −7.02 semitones ≈ −7.0 semitones
#
# F0 examples for 'baya' (Russian female speaker, typical F0 range 185–310 Hz):
# Natural F0 185 Hz (F#3) → perceived 123 Hz (B2) (deep male baritone)
# Natural F0 220 Hz (A3) → perceived 147 Hz (D3) (low baritone)
# Natural F0 280 Hz (C#4) → perceived 187 Hz (F#3) (baritone)
# Natural F0 310 Hz (Eb4) → perceived 207 Hz (G#3) (baritone)
#
# User-reported symptoms:
# "Voice sounds like a slow man, not the natural female voice we paid for"
# "Every announcement takes 50% longer than the script says it should"
# "Voice sounds creepy and slow — like a demon"
# "Same text that was 2 seconds with the old model is now 3 seconds"
#
# DNSMOS (quality metric):
# v2.3 delivery (correct): SIG 3.82, BAK 4.21, OVR 3.74
# v3 delivery (mismatch): SIG 2.41, BAK 4.20, OVR 2.18
# BAK unchanged (noise floor is correct); SIG and OVR degraded (voice quality)
Why four months of voice tuning could not fix a file header
The team received user complaints within two weeks of the v3 rollout that the voice sounded “slow and deep”. Because the v3 model family is known to produce somewhat richer bass characteristics relative to v2 (by design, as a quality improvement), the initial complaints were attributed to the v3 voice character being different from v2 and to users needing time to adjust. When complaints continued through the second and third month, the team began systematic tuning of TTS parameters.
# Month 1: Added loudness normalization post-processing
# Hypothesis: v3 voice is too quiet, making it sound muffled/deep
# Applied EBU R128 loudness normalization: target −23 LUFS
# Result: volume correct; voice still slow and low-pitched
# DNSMOS OVR: 2.18 → 2.21 (marginal improvement)
# User complaint rate: unchanged
# Conclusion: "volume not the issue; v3 character is simply different"
#
# Month 2: Switched speaker from 'baya' to 'xenia'
# Hypothesis: 'baya' speaker model has unusual acoustic characteristics in v3
# Loaded model with speaker='xenia' (different v3 Russian female speaker)
# soundfile.write(path, audio, 16000) ← Bug unchanged
# model.sample_rate = 24000 for 'xenia' as well
# Result: pitch still −7.0 semitones; speed still 1.5× too slow
# Reason: sample rate mismatch is model-wide, not speaker-specific;
# all v3 speakers output at 24000 Hz; bug is in the write call, not the speaker
# DNSMOS OVR: 2.19 (unchanged from 'baya'; same mismatch)
# Conclusion: "speaker change doesn't help; v3 may have inherent quality issues"
#
# Month 3: Reverted 2 of 5 IoT device model families from v3 back to v2.3
# Hypothesis: v3 quality is worse than v2 for this use case
# Reverted devices: 'kitchen' and 'hallway' device categories
# v2.3 delivery (sample_rate=16000 matches model.sample_rate=16000):
# voice correct speed, correct pitch — user complaints stop for reverted devices
# v3 delivery on remaining 'bedroom' and 'living room' devices:
# voice still slow and low-pitched — complaints continue
# Conclusion: "v3 is broken for this use case; v2 works" — but no one asked why v2 worked
# Wrong conclusion: team planned to fully revert all devices to v2.3
# Before completing revert: retainer consultant engaged to compare v2 vs v3 delivery
#
# Month 4: Retainer engagement
#
# Retainer triage (1.5h):
# Step 1 (0.3h): Compare v2.3 and v3 delivery code side by side
# v2.3 path: soundfile.write(path, audio, 16000); model.sample_rate=16000 ← match
# v3 path: soundfile.write(path, audio, 16000); model.sample_rate=24000 ← MISMATCH
# Mismatch identified immediately
# Step 2 (0.2h): Verify model.sample_rate attribute
# silero v2.3 model: model.sample_rate = 16000
# silero v3 model: model.sample_rate = 24000
# soundfile.info('v3-output.wav').samplerate = 16000 ← confirms wrong header
# Step 3 (0.5h): Fix delivery module; run end-to-end quality check
# soundfile.write(path, audio.numpy(), model.sample_rate)
# soundfile.info('v3-output-fixed.wav').samplerate = 24000 ← correct
# DNSMOS OVR: 2.18 → 3.71 (matches v2.3 quality)
# Duration: 0.9s phrase plays in 0.9s (was 1.35s)
# Pitch: −7.0 → 0 semitones
# Step 4 (0.5h): Audit all delivery paths; add model.sample_rate assertion;
# document: never hardcode sample rate — always use model.sample_rate;
# revert decision reversed: v3 models re-deployed on all devices
# with correct sample_rate=model.sample_rate
# 4 engineers × 4 months × $6,875/month = $110,000
The Month 3 revert decision narrowly avoided throwing away the v3 quality improvements across all device categories. The revert worked for the reverted device families because v2_3_ru has model.sample_rate = 16000, which matched the hardcoded write value — so the v2 delivery was accidentally correct. This confirmed that v3 was “broken” in the team’s view, but the actual interpretation — that v3 simply exposed a latent bug by changing its native sample rate from 16000 to 24000 Hz — was not reached until the retainer engagement. The fix was a single substitution: replace 16000 with model.sample_rate in soundfile.write(). Hours logged to HourTab with per-session breakdown.
# Fixed tts_service.py
import torch
import soundfile as sf
import numpy as np
model, example_text = torch.hub.load(
repo_or_dir='snakers4/silero-models',
model='silero_tts',
language='ru',
speaker='v3_1_ru'
)
model.eval()
# Assert sample rate is as expected; fail loudly if model changes again
assert model.sample_rate == 24000, (
f"model.sample_rate={model.sample_rate} — update assertion if model version changes"
)
def synthesize(text: str, speaker: str, output_path: str) -> None:
audio = model.apply_tts(
texts=[text],
sample_rate=model.sample_rate, # pass to apply_tts for consistency; v3 ignores it
speaker=speaker,
put_accent=True,
put_yo=True
)
sf.write(
output_path,
audio.numpy(),
model.sample_rate # ← FIX: derive from model, not hardcoded constant
)
# After fix — production results:
# Pitch shift: 0 semitones vs −7.0 semitones pre-fix
# Speed ratio: 1.00× vs 1.5× too slow pre-fix (audio plays at correct speed)
# Duration: correct vs 1.5× too long pre-fix
# DNSMOS OVR: 3.71 vs 2.18 pre-fix
# User complaints: stopped within 24h of fix deployment
# v3 models retained on all device categories
Related retainer posts
- magphase developer on retainer — magphase 2.3; MagPhase vocoder output 16000 Hz; delivery module
torchaudio.save(sample_rate=22050)from WaveGlow era; audio 1.38× too fast; pitch +5.6 semitones; fix:sample_rate=magphase_model.fs; 1.5h - aero developer on retainer — aero 0.1.0;
torchaudio.load()returns 44100 Hz;model.lr_sr=8000; no resample; output 5.5× longer; pitch 2.84 octaves lower; LSD 8.4 dB vs 1.2 dB; fix:resample(waveform, orig_freq=sr, new_freq=model.lr_sr); 1.5h - nemo tts developer on retainer — nemo_toolkit[tts] 1.17.0; FastPitch fine-tuned at
speaker=128; inference omitsspeakerkwarg; defaultspeaker=0(VCTK British male); similarity 0.29 vs 0.84; fix:generate_spectrogram(tokens=tokens, speaker=128); 1.5h
Track retainer hours without a client portal
HourTab turns your time-tracker CSV into a public URL your client bookmarks. No login. No portal. CSV in, URL out.
See pricing →