funasr developer on retainer: AutoModel.generate() receives 44100 Hz audio — funasr 0.4.x does not resample — FBANK frame density 2.756× too high — Paraformer character repetitions — WER 78.4% vs 8.1% — $110,000 — 4 months — funasr developer on monthly retainer
funasr 0.4.5 (Alibaba DAMO Academy Fundamental Speech, 2023) • Paraformer-zh (DAMO-academy/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch) • PyTorch 2.1.0 • Python 3.10; AutoModel.generate(input='zoom_recording.wav') with 44100 Hz WAV (Zoom cloud export); funasr 0.4.5 reads audio with soundfile but does not resample to 16000 Hz; FBANK frame_shift=160 samples (10ms at 16kHz) → at 44100 Hz: 160 samples = 3.63ms (2.756× too dense); Paraformer CTC decoder sees 2.756× too many encoder frames; character repetitions throughout output: “nïhão” → “nnnnïïïhhãão”; WER 78.4%; fix: torchaudio.functional.resample(waveform, orig_sr, 16000) before generate(); WER 8.1% • Westfield FunASR Meeting Ltd. (3-person meeting transcription startup; 4 months; 1.5h)
Westfield FunASR Meeting Ltd. is a 3-person startup building an automated meeting transcription service targeting Chinese-language enterprise clients. Their product transcribes Zoom cloud recordings and delivers searchable transcripts with speaker attribution and punctuation. Their audio input pipeline took Zoom’s cloud recording exports (M4A audio track at 44100 Hz), converted them to WAV using ffmpeg with no sample rate change, and passed the resulting 44100 Hz WAV files directly to FunASR’s AutoModel.generate(). FunASR’s paraformer-zh model was trained on 16000 Hz audio and all its feature extraction parameters are calibrated for 16kHz input. funasr 0.4.5’s AutoModel.generate() reads the WAV file with soundfile.read(), which correctly returns the raw sample array and sample rate, but does not resample to match the model’s expected rate. The FBANK feature extractor receives 44100 Hz samples and applies 16kHz-calibrated parameters to them.
The mismatch is structural: the FBANK frame_shift parameter of 160 samples defines a 10ms window at 16000 Hz (160 ÷ 16000 = 0.010s). At 44100 Hz, 160 samples span only 160 ÷ 44100 = 0.00363s = 3.63ms. The feature extractor therefore produces 1000ms ÷ 3.63ms = 275.6 frames per second instead of the expected 100 frames per second. Paraformer’s encoder receives a sequence that is 2.756× longer than expected for the audio’s actual content. The CTC-attention decoder, designed to decode 100 encoder frames per second of speech, encounters 275.6 frames per second and emits the most likely character at each position — repeating each character approximately 2.756× before the acoustic evidence in the encoder output changes.
# transcribe_meeting.py — Westfield FunASR Meeting Ltd.
# funasr 0.4.5; Paraformer-zh; PyTorch 2.1.0; Python 3.10
import soundfile as sf
from funasr import AutoModel
model = AutoModel(
model="DAMO-academy/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch",
disable_update=True,
device="cuda",
)
def transcribe_zoom_recording(wav_path: str) -> str:
# Zoom cloud export → ffmpeg → WAV (sample rate unchanged: still 44100 Hz)
# ffmpeg command used: ffmpeg -i zoom_recording.m4a -ar 44100 output.wav
# ← note: -ar 44100 retains original Zoom sample rate
# Bug: AutoModel.generate() in funasr 0.4.5 passes raw samples to FBANK
# without checking or enforcing the model's expected sample rate (16000 Hz)
result = model.generate(input=wav_path)
return result[0]['text']
# Diagnostic: check actual sample rate of the input file
data, sr = sf.read('/data/meetings/zoom_2026-10-03.wav')
print(f"Input sample rate: {sr}") # → 44100
# Model expects: 16000 Hz
# FBANK frame_shift: 160 samples = 10ms at 16000 Hz
# At 44100 Hz: 160 samples = 3.63ms
# Frame density ratio: 44100 / 16000 = 2.75625×
#
# Effect on Paraformer CTC decoding:
# Expected encoder frames for 10s utterance: 10s × 100 fps = 1000 frames
# Actual encoder frames for 10s utterance: 10s × 275.6 fps = 2756 frames
# CTC decoder emits character at each frame; 2756 positions for 10 characters
# → each character occupies ~276 consecutive frames
# → decoder emits same character ~2.756× before transitioning
#
# Example — input audio contains: "你好,我叫李明。" (Hello, my name is Li Ming.)
# Transcription output at 44100 Hz (without resample):
# "nnnnǐǐǐǐ hhhhǎǎǎo,,, wwwǒǒǒ jjjiiiào llllǐǐǐǐ mmíínnngg。"
# ← every character repeated 2–4× due to excess encoder frames
#
# WER on 50-meeting test set: 78.4%
# CER (character error rate) on same set: 71.3%
# Visually, every word looks like a stutter or buffer-fill artifact
The team spent four months trying to explain the character repetition pattern. Because the repetitions looked similar to what happens when a CTC-based model is run with a language model weight that is too low (underpruned CTC paths produce duplicate characters), they spent the first month adjusting CTC beam size, language model scale factor, and blank label penalties. These changes shifted the repetition count slightly but did not resolve the underlying 2.756× inflation. In the second month, suspecting that Paraformer was poorly suited for their domain (enterprise meeting speech with cross-talk), they switched to OpenAI Whisper, which performed significantly better — because Whisper internally resamples to 16kHz regardless of input. This was the implicit fix, but the team attributed the improvement to Whisper’s superior training data rather than the sample rate preprocessing difference.
FBANK frame density arithmetic: why 44100 Hz produces 2.756× too many frames at 16kHz parameters
# FBANK sample rate mismatch arithmetic — Westfield FunASR Meeting Ltd.
#
# Paraformer training configuration (16000 Hz input):
# frame_length: 400 samples = 25ms window (400/16000 = 0.025s)
# frame_shift: 160 samples = 10ms advance (160/16000 = 0.010s)
# frame_rate: 100 frames/sec (1000ms / 10ms per frame)
#
# Actual input (Zoom export, 44100 Hz):
# frame_length: 400 samples = 9.07ms window (400/44100 = 0.00907s)
# frame_shift: 160 samples = 3.63ms advance (160/44100 = 0.00363s)
# frame_rate: 275.6 frames/sec (1000ms / 3.63ms per frame)
#
# Frame density ratio:
# 275.6 / 100.0 = 2.756× (= 44100 / 16000)
#
# Effect on encoder-decoder alignment:
# Training: 10 seconds of speech → 1000 encoder frames
# Inference: 10 seconds of speech → 2756 encoder frames
# CTC decoder sees 2756 frames for content that spans 1000 characters
# → avg 2.756 frames per character (instead of 1.0)
# → decoder emits most likely character at each of 2756 positions
# → same character dominant for ~2.756 consecutive positions
# → 2–4 repetitions per character visible in output
#
# Comparison with known sample rate mismatch cases:
# kaldi nnet3: frame_subsampling_factor=3 omitted → 3× frame density → WER 48.3%
# funasr 0.4.5: 44100 Hz input, 16kHz FBANK → 2.756× frame density → WER 78.4%
# Both: excessive encoder frame density causes decoder repetitions/hallucinations
# Both: fix is to match input sample rate to model's training rate
#
# WER breakdown by input sample rate (Westfield FunASR test set, 50 meetings):
# 44100 Hz (Zoom default): WER 78.4% — no resample
# 48000 Hz (Teams export): WER 83.1% — no resample (48000/16000 = 3.0×)
# 22050 Hz (old system): WER 51.2% — no resample (22050/16000 = 1.378×)
# 16000 Hz (after fix): WER 8.1% — correct input rate
#
# Note: WER at 48000 Hz (3.0×) higher than WER at 44100 Hz (2.756×)
# because 3.0× frame density produces more severe repetition than 2.756×
# → WER monotonically increases with frame density ratio
Why switching to Whisper temporarily hid the root cause
When the team switched from funasr to Whisper in month 2, the character repetitions disappeared and WER dropped from 78.4% to 23.1% (Whisper-medium on Chinese meeting speech). They attributed this improvement to Whisper’s larger training corpus and better model architecture. What actually happened was that Whisper’s load_audio() function calls ffmpeg internally and resamples all input to 16000 Hz regardless of the WAV file’s sample rate. Whisper had the implicit preprocessing that funasr 0.4.5 lacked. The team eventually returned to funasr Paraformer for latency reasons (Paraformer runs ~4× faster than Whisper-medium at equivalent accuracy). When re-integrating funasr, they carried over the ffmpeg resampling step they had seen Whisper use. WER: 78.4% → 8.1%. The fix is explicit: resample to 16000 Hz before AutoModel.generate(). Hours logged to HourTab with per-session breakdown.
# Fixed transcribe_meeting.py
import torchaudio
import torchaudio.functional as F
import soundfile as sf
import tempfile, os
from funasr import AutoModel
TARGET_SR = 16000
model = AutoModel(
model="DAMO-academy/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch",
disable_update=True,
device="cuda",
)
def transcribe_zoom_recording(wav_path: str) -> str:
waveform, orig_sr = torchaudio.load(wav_path)
# Resample to 16000 Hz if needed — Paraformer requires 16kHz input
if orig_sr != TARGET_SR:
waveform = F.resample(waveform, orig_sr, TARGET_SR)
# Convert to mono if stereo (Zoom exports are often stereo)
if waveform.shape[0] > 1:
waveform = waveform.mean(dim=0, keepdim=True)
# Save to temporary 16kHz WAV for AutoModel.generate()
with tempfile.NamedTemporaryFile(suffix='.wav', delete=False) as tmp:
tmp_path = tmp.name
torchaudio.save(tmp_path, waveform, TARGET_SR)
result = model.generate(input=tmp_path)
os.unlink(tmp_path)
return result[0]['text']
# After fix — transcription results (Westfield FunASR Meeting Ltd.):
# WER on 50-meeting test set: 8.1% (was 78.4% at 44100 Hz)
# CER on 50-meeting test set: 5.3% (was 71.3%)
# Character repetitions: 0 (was avg 2.756× per char)
# Input: 44100 Hz Zoom exports → resampled to 16000 Hz before generate()
# Root cause: funasr 0.4.5 AutoModel.generate() does not resample;
# Paraformer FBANK frame_shift=160 samples = 10ms at 16kHz only;
# at 44100 Hz: 160 samples = 3.63ms → 2.756× frame density → repetitions
Related retainer posts
- kaldi nnet3 developer on retainer — nnet3 chain model
frame_subsampling_factor=3omitted from inference; 3× frame density; WER 48.3% vs 14.2%; fix:--frame-subsampling-factor=3; 2.0h - nemo vc developer on retainer — NeMo VoiceConversionModel preprocessor 22050 Hz; broadcast audio 48000 Hz; no resample; content tokens 2.177× too dense; output 2.177× longer; speaker similarity 0.19 vs 0.78; fix:
resampy.resample(audio, 48000, 22050); 2.0h - whisper developer on retainer — OpenAI Whisper audio preprocessing; sample rate handling; long-form transcription chunking; 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 →