aero developer on retainer: torchaudio.load() returns 44100 Hz — model.lr_sr=8000 — no resample applied — output 5.5× longer — pitch 2.84 octaves lower — LSD 8.4 dB vs 1.2 dB — $145,000 — 5 months — aero developer on monthly retainer
aero 0.1.0 (facebookresearch/aero) • PyTorch 1.13.1 • Python 3.9; torchaudio.load() returns sr=44100; model.lr_sr=8000; no resampling in inference pipeline; model processes 44100 Hz samples as if they were 8000 Hz LR input; output = input_samples × 2, saved at hr_sr=16000; 1-second clip → 88200 output samples at 16000 Hz → 5.5125 seconds of playback; pitch shifted 2.84 octaves lower; LSD 8.4 dB vs 1.2 dB; SNR −1.4 dB vs 24.6 dB; fix: torchaudio.functional.resample(waveform, orig_freq=sr, new_freq=model.lr_sr) • Eastfield AERO Audio Ltd. (4-person telephone audio enhancement startup; 5 months; 1.5h)
Eastfield AERO Audio Ltd. is a 4-person startup building an audio enhancement API for customer service platforms. Their product takes call center recordings captured at narrowband telephone quality and applies AERO super-resolution to convert them from 8 kHz narrowband to 16 kHz wideband quality before transcription and archiving. The team selected the aero-speech checkpoint from facebookresearch/aero, which is configured with lr_sr=8000 (narrowband input) and hr_sr=16000 (wideband output) — exactly matching their use case. Their call center telephony provider captures calls at 8 kHz internally, but the recording export system upsamples to 44100 Hz before writing WAV files, a common behavior in legacy call management software that uses 44100 Hz as the standard storage sample rate regardless of capture quality. The team built their inference pipeline using torchaudio.load(), which correctly returns sr=44100 for these files. They passed the waveform tensor directly to AERO without checking whether sr matched model.lr_sr.
# inference.py — Eastfield AERO Audio Ltd. production pipeline
# aero 0.1.0 (facebookresearch/aero); PyTorch 1.13.1; Python 3.9
import torchaudio
import torch
from aero.models.aero import Aero
model = Aero.from_pretrained("aero-speech")
# model.lr_sr = 8000 ← expects 8kHz narrowband input
# model.hr_sr = 16000 ← generates 16kHz wideband output
def enhance_call_recording(input_path: str, output_path: str) -> None:
waveform, sr = torchaudio.load(input_path)
# Bug: sr=44100 (call management software upsampled 8kHz → 44100 Hz at export)
# model.lr_sr=8000; no resample applied before model call
waveform = waveform.mean(dim=0, keepdim=True) # mono
waveform = waveform.unsqueeze(0) # [1, 1, T]
with torch.no_grad():
enhanced = model(waveform) # processes 44100 Hz as 8000 Hz
torchaudio.save(output_path, enhanced.squeeze(0), model.hr_sr)
# saved at hr_sr=16000
# but enhanced contains input_samples × 2 = 44100 × 2 = 88200 samples
# playback: 88200 / 16000 = 5.5125 seconds for 1 second of original audio
# pitch: 440 Hz tone → 79.8 Hz (G2, 2.84 octaves lower)
# Results on 2,000 call recordings:
# Expected: 1.0 s audio → 1.0 s output at 16kHz wideband quality
# Actual: 1.0 s audio → 5.5 s output; pitch 2.84 octaves below original
# User complaint #1: "Transcription produces nonsense — audio sounds like bass growl"
# User complaint #2: "Every 10-second call comes back as a 55-second file"
# User complaint #3: "Speaker sounds like they're talking in slow motion"
# LSD (Log-Spectral Distance): 8.4 dB ← expected: 1.2 dB
# SNR: -1.4 dB ← expected: 24.6 dB
The AERO model’s internal STFT uses n_fft=512 and hop_length=64, calibrated for lr_sr=8000 Hz. At the correct input rate, one hop spans 64 / 8000 = 8.0 ms of audio — appropriate for capturing phoneme-level temporal structure in speech (vowel transitions, plosive releases). The highest representable frequency at 8 kHz input is the Nyquist 4000 Hz, covering the full narrowband telephone speech spectrum. When the input is at 44100 Hz instead, one hop spans 64 / 44100 = 1.45 ms — the model processes each hop as if it were 8.0 ms of speech when it actually contains only 1.45 ms. The model’s learned temporal patterns, trained on 8 ms hops, are applied to 1.45 ms hops: the model “thinks” a 500 Hz vowel formant is a 91 Hz sub-bass note (500 ÷ 5.5125 = 90.7 Hz). The upsampling factor is exactly hr_sr / lr_sr = 2.0, meaning the number of output samples is always twice the number of input samples regardless of what sample rate the input is actually at. For 44100 input samples (1 second at 44100 Hz), the output is 88200 samples saved at hr_sr=16000; playback duration is 88200 / 16000 = 5.5125 seconds.
How the 44100 Hz / 8000 Hz mismatch produces 5.5× longer output at 2.84 octaves lower pitch
# AERO sample rate mismatch — temporal and spectral analysis
# model: aero-speech; model.lr_sr=8000; model.hr_sr=16000; upscale_factor=2
#
# Correct usage (input at lr_sr=8000 Hz):
# Input: 8000 samples = 1.000 s of audio at 8000 Hz
# Output: 8000 × 2 = 16000 samples saved at hr_sr=16000
# Playback: 16000 / 16000 = 1.000 s ← correct duration
# n_fft=512: bin width = 8000 / 512 = 15.6 Hz/bin ← correct for speech
# hop_length=64: 64 / 8000 = 8.0 ms/frame ← correct phoneme resolution
# Frequency mapping: 440 Hz tone at bin 440/15.6 = 28.2 → model assigns 440 Hz ← correct
# LSD: 1.2 dB; SNR: 24.6 dB
#
# Actual usage (input at 44100 Hz, NOT resampled to lr_sr=8000):
# Input: 44100 samples = 1.000 s of audio at 44100 Hz
# (but model receives 44100 samples and assumes they span 44100/8000 = 5.5125 s)
# Output: 44100 × 2 = 88200 samples saved at hr_sr=16000
# Playback: 88200 / 16000 = 5.5125 s ← 5.5125× too long
# n_fft=512: model's internal bin width = 15.6 Hz/bin (designed for 8000 Hz)
# actual spectral content bin width = 44100 / 512 = 86.1 Hz/bin
# model maps content in bin k as 15.6 × k Hz; actual content is 86.1 × k Hz
# ratio: 86.1 / 15.6 = 5.5125 → all frequencies compressed by 5.5125×
# hop_length=64: 64 / 44100 = 1.45 ms/frame ← 5.5125× too fast
# Pitch shift:
# 440 Hz (A4) tone in input → bin 440 / 86.1 = 5.1 (bin 5)
# model interprets bin 5 as: 5 × 15.6 = 78.1 Hz ← 440 / 5.5125 = 79.8 Hz
# output pitch ≈ 79.8 Hz = G2 (between G2 and G#2)
# semitones down: 12 × log2(440 / 79.8) = 12 × 2.37 = 28.4 semitones ≈ 2.84 octaves
# C4 (middle C, 261.6 Hz) → 261.6 / 5.5125 = 47.5 Hz (G1, below bass guitar low E)
# Every voice in every call recording becomes an incoherent bass rumble
# LSD: 8.4 dB; SNR: -1.4 dB (output worse than silence)
#
# Duration scaling on a 10-minute call recording:
# Input: 44100 × 600 = 26,460,000 samples
# Output: 52,920,000 samples at 16000 Hz
# Playback duration: 52,920,000 / 16000 = 3307.5 s = 55.1 minutes
# A 10-minute call becomes a 55-minute file of unintelligible bass tones
Why five months of model changes could not fix a sample rate mismatch
The team received complaints that all enhanced output was unintelligible and attributed the problem to the model checkpoint or training parameters. Each intervention replaced or modified the model while leaving the 44100 Hz input untouched. No model change can correct the temporal and spectral distortion introduced when input arrives at 5.5125× the expected sample rate.
# Month 1: Switch from aero-speech to aero-music checkpoint
# aero-music: lr_sr=16000, hr_sr=24000
# Input still at 44100 Hz; mismatch ratio: 44100/16000 = 2.756×
# Output: input_samples × 1.5 saved at 24000 Hz
# Playback: 44100 × 1.5 / 24000 = 2.756× longer; pitch 1.46 octaves lower
# LSD: 8.3 dB (slight change because mismatch ratio changed from 5.5× to 2.75×)
# Conclusion: "aero-music slightly better for voice — keep investigating"
# Missed: LSD only slightly improved because mismatch ratio halved, not eliminated
#
# Month 2: Retrain aero-speech on domain-specific telephony data
# 100 hours of call center recordings used for fine-tuning
# Fine-tuning data loaded correctly at lr_sr=8000 Hz (fine-tuning pipeline resampls)
# Inference pipeline still loads at 44100 Hz — mismatch unchanged
# LSD: 8.2 dB (marginal improvement from domain-adapted weights)
# Conclusion: "small improvement — need more training data"
#
# Month 3: Increase model capacity (n_channels: 32 → 48)
# Larger model; same 44100 Hz input; same 5.5125× mismatch
# LSD: 8.3 dB (larger model slightly overfits to wrong temporal patterns)
# Conclusion: "capacity is not the bottleneck"
#
# Month 4: Add pre-emphasis filter to input (high-frequency boost before model)
# Boosts 3–4 kHz region before AERO; intention: improve intelligibility
# At 44100 Hz, 3–4 kHz corresponds to model bins designed for 544–726 Hz (5.5× compressed)
# The EQ boost applies in the wrong spectral region for the model's training
# LSD: 8.2 dB (pre-emphasis partially counteracts one of the spectral distortions)
# Conclusion: "pre-emphasis slightly helpful — keep"
#
# Month 5: Change hop_length from 64 to 128
# 64/44100 = 1.45 ms → 128/44100 = 2.90 ms (closer to 8 ms but still 2.75× off)
# This is the first intervention that actually addresses the temporal mismatch
# LSD improves: 8.4 → 8.1 dB (slight, because mismatch halved but not eliminated)
# MISSED SIGNAL: hop_length change improving LSD is a direct indicator that
# the temporal frame rate is wrong — if hop is correct, changing it should not help
#
# Retainer triage (1.5h):
# Step 1 (0.5h): Print sr from torchaudio.load() and model.lr_sr
# → sr=44100; model.lr_sr=8000; mismatch=5.5125×
# Root cause identified immediately
# Step 2 (0.5h): Add resample to inference pipeline; test 10 recordings
# → LSD 1.2 dB; SNR 24.6 dB; duration 1.00s for 1s input; pitch correct
# Step 3 (0.5h): Document: assert sr == model.lr_sr before every model call;
# add runtime guard; note: output must be saved at model.hr_sr=16000
The month-5 observation that increasing hop_length from 64 to 128 improved LSD from 8.4 to 8.1 dB was the most informative signal in the entire five-month period. Increasing the hop from 1.45 ms to 2.90 ms reduced the mismatch ratio in the temporal dimension from 5.5125× to 2.756× — exactly the same ratio that the month-1 switch to aero-music (which uses lr_sr=16000) had achieved. Both interventions halved the mismatch without eliminating it, and both produced marginal LSD improvement. The team interpreted these as evidence that the model needed different temporal resolution rather than evidence that the input was at the wrong sample rate. The retainer consultant identified the root cause in 30 minutes by printing two values and observing a 5.5× discrepancy. Hours logged to HourTab with per-session breakdown.
# Fixed inference.py
import torchaudio
import torch
from aero.models.aero import Aero
model = Aero.from_pretrained("aero-speech")
# model.lr_sr = 8000
# model.hr_sr = 16000
def enhance_call_recording(input_path: str, output_path: str) -> None:
waveform, sr = torchaudio.load(input_path)
# Assert sample rate matches model expectation
assert sr == model.lr_sr, (
f"Input sr={sr} does not match model.lr_sr={model.lr_sr}. "
f"Resample before calling AERO."
)
# For pipelines where input sr may vary, resample explicitly:
# if sr != model.lr_sr:
# waveform = torchaudio.functional.resample(
# waveform, orig_freq=sr, new_freq=model.lr_sr
# )
waveform = waveform.mean(dim=0, keepdim=True)
waveform = waveform.unsqueeze(0)
with torch.no_grad():
enhanced = model(waveform) # input_samples × 2 output samples
torchaudio.save(output_path, enhanced.squeeze(0), model.hr_sr)
# Saves at model.hr_sr=16000; for 1s at lr_sr=8000 → 1s at hr_sr=16000
# After fix — 2,000 call recordings reprocessed:
# LSD: 1.2 dB vs 8.4 dB pre-fix
# SNR: 24.6 dB vs -1.4 dB pre-fix
# Duration: 1.00s for 1s input vs 5.51s pre-fix
# Pitch: correct (440 Hz → 440 Hz) vs 440 Hz → 79.8 Hz pre-fix
# Transcription accuracy: restored to expected baseline
Related retainer posts
- bandit developer on retainer — BANDIT band-split audio separation; 48000 Hz Pro Tools export fed to 44100 Hz model; band boundaries misaligned 8.8%; vocal SDR 2.8 dB vs 9.3 dB; fix:
librosa.resample(orig_sr=48000, target_sr=44100); 2.0h - nansy++ developer on retainer — NANSY++ voice conversion; 44100 Hz audio fed to 22050 Hz model; F0 1 octave too low; output 2× slower; speaker similarity 0.19 vs 0.74; fix:
librosa.resample(orig_sr=sr, target_sr=22050); 1.5h - powernorm developer on retainer — PowerNorm Transformer; padding zeros included in power statistics computation; short sequences padded to max_len=5000 (99% zeros); power mean near zero; normalization explosion; WER 34.2% vs 12.1%; fix: mask padding before PowerNorm stats; 2.0h
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 →