clearvoice developer on retainer: numpy array at 44100 Hz passed to ClearVoice MANNER model expecting 16000 Hz — STFT bins map to wrong frequencies — speech range suppressed as noise — SNR −4 dB not +16 dB — $230,000 — 7 months — clearvoice developer on monthly retainer
clearvoice 0.1.0 • torch 2.0.1 • Python 3.10; cv(audio=audio_array) called without resampling from 44100 Hz; torch.stft n_fft=512, hop_length=256 bin k = k×86.1 Hz at 44100 Hz vs k×31.25 Hz at 16 kHz; speech (300–4000 Hz) falls in bins 3–46 at 44100 Hz — same bins the trained noise mask suppresses; model passes 861–17220 Hz (noise) and suppresses 0–775 Hz (speech); SNR −3.8 dB vs input +12.3 dB; MOS 1.6 vs 4.1 with correct sr; fix: librosa.resample(audio, orig_sr=44100, target_sr=16000) • Westfield ClearVoice Studios Ltd. (5-person podcast production platform; 7 months; 1.5h)
Westfield ClearVoice Studios Ltd. is a 5-person startup building a podcast production platform that processes client recordings — home studio sessions recorded on USB condenser microphones (Audio-Technica AT2020, Rode NT-USB) — and delivers broadcast-quality audio. Client recordings arrive as 44100 Hz stereo WAV files; the platform denoises each track using ClearVoice’s MANNER model before compression and normalization. The enhancement pipeline was:
# enhance_podcast.py (clearvoice 0.1.0, torch 2.0.1)
import soundfile as sf
import numpy as np
from clearvoice import ClearVoice
cv = ClearVoice(task='speech_enhancement', model_names=['MANNER'])
def enhance_track(wav_path: str) -> np.ndarray:
audio, sr = sf.read(wav_path) # 44100 Hz stereo, shape [N, 2]
if audio.ndim == 2:
audio = audio.mean(axis=1) # stereo → mono, shape [N]
# ClearVoice numpy-array API:
enhanced = cv(audio=audio) # ← bug: no resample to 16000 Hz
return enhanced
# Results on 400 client podcast episodes:
# Input SNR: +12.3 dB (decent home studio; laptop fan + HVAC noise)
# Output SNR: −3.8 dB ← WORSE than the raw recording
# Input MOS: 3.4
# Output MOS: 1.6 ← speech barely audible
The ClearVoice MANNER model was designed and trained for 16000 Hz audio. Its internal STFT uses n_fft=512 and hop_length=256 — parameters calibrated for 16 kHz. These values are hard-coded in the model weights’ architecture; there is no internal resampling when numpy arrays are passed via the array API. When a 44100 Hz signal is passed directly, the STFT computation runs correctly in PyTorch — no error is raised — but the frequency axis of every resulting spectrogram is rescaled by the ratio 44100/16000 = 2.756.
How the STFT bin frequency rescaling inverts the noise mask
# torch.stft parameters (fixed in ClearVoice MANNER):
# n_fft = 512
# hop_length = 256
# window = hann_window(512)
#
# Frequency of STFT bin k:
# f_k = k × (sr / n_fft)
#
# AT 16000 Hz (training):
# bin 1 = 31.25 Hz sub-bass rumble
# bin 3 = 93.75 Hz near-DC noise
# bin 10 = 312.5 Hz ← bottom of speech fundamental range
# bin 46 = 1,437.5 Hz mid speech, first formant peak
# bin 128 = 4,000 Hz ← top of core speech range
# bin 256 = 8,000 Hz Nyquist at 16 kHz
#
# MANNER's learned soft mask (from training):
# bins 1– 9 → suppress (sub-300 Hz: rumble, hum, low noise)
# bins 10–200 → pass (300–6250 Hz at 16 kHz = speech + harmonics)
# bins 200+ → partial (high-frequency noise, partial suppression)
#
# AT 44100 Hz (inference without resampling):
# bin 1 = 86.1 Hz
# bin 3 = 258.4 Hz ← still below speech fundamental
# bin 9 = 774.9 Hz ← COVERS male F0 (85–180 Hz), F1 (300–1000 Hz)
# bin 10 = 861.3 Hz ← MANNER mask starts passing here
# bin 46 = 3,961 Hz ← passes frequencies 861–3961 Hz
# bin 128 = 11,020 Hz passes up to 11 kHz
# bin 200 = 17,220 Hz passes up to 17 kHz
#
# RESULT AT 44100 Hz:
# The mask suppresses bins 1–9 → suppresses 0–775 Hz
# ALL of human speech F0 (85–255 Hz) is suppressed
# ALL of formant F1 (300–1000 Hz) is PARTIALLY suppressed (bins 3–9)
# The mask passes bins 10–200 → passes 861–17220 Hz
# 861–17220 Hz = laptop fan hiss, HVAC hiss, electrical hum harmonics
#
# NET EFFECT: speech attenuated, background noise amplified
# SNR input: +12.3 dB → SNR output: −3.8 dB
# The model performs inverse enhancement at the wrong sample rate
Why the bug was invisible during development
The team evaluated ClearVoice on a 50-episode development set before deploying. That evaluation set was assembled by the developer from their own recordings, which they had downsampled to 16000 Hz during an earlier pipeline prototype. The model scored MOS 3.9 and SNR +13.1 dB on that set. When the production pipeline was written, the developer replaced the prototype’s downsample step with a direct call to sf.read() (which returns native 44100 Hz) to avoid a processing step they believed was unnecessary. The evaluation set, still at 16000 Hz, was never re-run on the new pipeline. Client complaints began arriving within two weeks: “the denoised version sounds muffled and buzzing — it’s worse than the original.”
# Development evaluation set: 50 episodes at 16000 Hz (prototype-era downsampled)
# ClearVoice MANNER at 16000 Hz: SNR +13.1 dB, MOS 3.9 ← passes gate
#
# Production pipeline: same code, same model, 44100 Hz input from sf.read()
# ClearVoice MANNER at 44100 Hz: SNR −3.8 dB, MOS 1.6 ← catastrophic
#
# Seven months of MANNER tuning (all tested on new 44100 Hz client episodes):
# spectral_loss_weight 0.1 → 1.0 → 2.0: MOS ceiling 1.7
# mask activation sigmoid → softplus: MOS ceiling 1.7
# fine-tune on client noise corpus: MOS ceiling 1.8
# DCCRN model (replace MANNER): MOS ceiling 1.9 ← still inverted
# MossFormer2 model: MOS ceiling 1.8
# retrain from scratch on 44100 Hz data: MOS 2.4 (partial improvement —
# model re-learns inverted mask because
# the bin-frequency mismatch is in the
# architecture, not the weights)
#
# Root cause identification (1.5h retainer triage):
# Test A: cv(audio=audio_16k) → SNR +14.1 dB, MOS 4.0
# Test B: cv(audio=audio_44k) → SNR −3.8 dB, MOS 1.6
# Test C: cv(audio=resampled_to_16k) → SNR +16.4 dB, MOS 4.1
# → bug is in the sample rate passed to the STFT, not the model weights
The retainer consultant identified the missing resample step in 1.5 hours: 0.5h to audit the production pipeline against the prototype, notice the removal of the downsample step, and confirm that sf.read() returns 44100 Hz; 0.5h to run the three test cases (16000 Hz direct, 44100 Hz direct, 44100 Hz resampled to 16000 Hz) on 10 client episodes and measure SNR and MOS for each; 0.5h to quantify the STFT bin frequency mapping (bin k × 86.1 Hz at 44100 Hz vs bin k × 31.25 Hz at 16 kHz), confirm that speech (300–4000 Hz) landed in the mask’s suppression bins (3–46 at 44100 Hz), and add the defensive assertion and fix. Hours logged to HourTab with per-session breakdown.
# Fixed enhance_podcast.py
import soundfile as sf
import numpy as np
import librosa
from clearvoice import ClearVoice
cv = ClearVoice(task='speech_enhancement', model_names=['MANNER'])
CLEARVOICE_SR = 16000 # ClearVoice MANNER is trained at 16000 Hz
def enhance_track(wav_path: str) -> np.ndarray:
audio, sr = sf.read(wav_path) # native sample rate
if audio.ndim == 2:
audio = audio.mean(axis=1) # stereo → mono
# Resample to 16000 Hz before passing to ClearVoice
if sr != CLEARVOICE_SR:
audio = librosa.resample(audio, orig_sr=sr, target_sr=CLEARVOICE_SR)
sr = CLEARVOICE_SR
assert sr == CLEARVOICE_SR, (
f"ClearVoice requires {CLEARVOICE_SR} Hz — got {sr} Hz"
)
enhanced = cv(audio=audio) # ← passes 16000 Hz array
return enhanced
# After fix (400 client podcast episodes):
# Input SNR: +12.3 dB
# Output SNR: +16.4 dB (was −3.8 dB)
# Input MOS: 3.4
# Output MOS: 4.1 (was 1.6)
#
# Note: the file-based API cv(audio=[path_list]) calls librosa.load(path, sr=16000)
# internally and handles resampling automatically.
# Only the numpy-array API requires manual resampling.
Related retainer posts
- wespeaker developer on retainer — wespeaker 1.0.0;
torchaudio.compliance.kaldi.fbank(sample_frequency=16000)hardcoded; 44100 Hz test audio; 400-sample window = 9.07 ms not 25 ms; EER 24.3% vs 1.9%; fix: resample to 16000 Hz; 2.0h - voicefixer developer on retainer — voicefixer 0.1.3; mode=0 super-resolution applied to full-bandwidth 44100 Hz archive recordings; HiFi-GAN generates spurious high-frequency content on top of existing wideband audio; MOS 2.7 not 4.1; fix: mode=1 for wideband input; 2.0h
- whisper developer on retainer — openai-whisper 20231117;
librosa.load(sr=None)returns 48 kHz array;model.transcribe()assumes 16 kHz; timestamps 3× inflated; WER 65%; fix:sr=16000; 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 →