BigVGAN v2 developer on retainer: bigvgan_v2_44khz_128band_512x receives 80-band LJSpeech mel — zero-padded to 128 bands — no energy above 5.6 kHz — MOS 2.5 vs 4.0 — $130,000 — 4 months — BigVGAN v2 developer on monthly retainer

bigvgan v2 (NVIDIA/BigVGAN, Nov 2024); bigvgan_v2_44khz_128band_512x (44.1 kHz output, 128-band mel, upsample 512×) • FastSpeech 2 acoustic model (LJSpeech; 22050 Hz; 80-band mel; hop_size=256; fmax=8000) • PyTorch 2.1.0 • Python 3.11; acoustic model outputs [B, 80, T]; vocoder forward() requires [B, 128, T]; shape mismatch patched with F.pad(mel, (0,0,0,48)); bands 80–127 = 0.0; BigVGAN v2 44 kHz mel scale: band 80 ≈ 5.6 kHz; no acoustic evidence above 5.6 kHz; synthesized audio has hard HF cutoff; MOS 2.5 vs 4.0; PESQ 2.1 vs 4.1; fix: use bigvgan_v2_22khz_80band_256x • Eastfield BigVGAN TTS Ltd. (4-person audiobook TTS API startup; 4 months; 2.0h)

Eastfield BigVGAN TTS Ltd. is a 4-person startup building an audiobook text-to-speech API for small and mid-size publishers. Their product accepts manuscript text and returns publication-quality audio narration, with a target MOS of 4.0+ for use in professional audiobook production. Their TTS pipeline used FastSpeech 2 (trained on LJSpeech 22.05 kHz) as the acoustic model, with Griffin-Lim as the vocoder. Griffin-Lim achieved MOS 4.0 in their internal evaluation but produced a characteristic metallic phase-reconstruction artifact on sibilants and fricatives (“s”, “sh”, “f”). When NVIDIA released BigVGAN v2 in late 2024 with published MOS scores of 4.3–4.5, the team decided to swap the vocoder. They downloaded the highest-quality checkpoint, bigvgan_v2_44khz_128band_512x, reasoning that 44.1 kHz CD-quality output would be the best choice for a professional production API.

When they called vocoder.forward(mel_spectrogram) with their FastSpeech 2 output, they got an immediate RuntimeError: the vocoder’s first convolutional layer expected 128 input channels but received 80. They patched this with torch.nn.functional.pad(mel, (0, 0, 0, 48)), extending the mel tensor from 80 to 128 bands by zero-filling the last 48 channels. The error disappeared. Audio was synthesized at 44.1 kHz. But listening tests revealed that the output sounded worse than Griffin-Lim: thinner, muffled, as if heard through a telephone. MOS: 2.5. The team spent four months investigating, suspecting a corrupted checkpoint, a CUDA version issue, or a bug in their FastSpeech 2 model, before engaging the retainer.

# synthesize_audiobook.py — Eastfield BigVGAN TTS Ltd.
# bigvgan v2 (NVIDIA/BigVGAN Nov 2024); PyTorch 2.1.0; Python 3.11

import torch
import torch.nn.functional as F

# BigVGAN v2: load 44kHz 128-band checkpoint
import bigvgan
vocoder = bigvgan.BigVGAN.from_pretrained('nvidia/bigvgan_v2_44khz_128band_512x')
vocoder.eval()

# FastSpeech 2: LJSpeech config
# acoustic model outputs mel: [batch, num_mels=80, time]
acoustic_model = load_fastspeech2('checkpoints/fastspeech2_ljspeech.pth')

def synthesize(text: str) -> torch.Tensor:
    mel = acoustic_model(text)   # → [1, 80, T]; 22050 Hz, 80 mels, fmax=8000

    # Bug: vocoder.forward() first conv layer: Conv1d(in_channels=128, ...)
    # mel has 80 channels → RuntimeError
    # "Team fix": zero-pad mel from 80 → 128 bands
    mel_padded = F.pad(mel, (0, 0, 0, 48))  # → [1, 128, T]
    # Bands 80-127 are now 0.0

    with torch.no_grad():
        audio = vocoder(mel_padded)  # → [1, 1, T * 512]; 44100 Hz

    return audio.squeeze()

# Problem: what do bands 80-127 represent in bigvgan_v2_44khz_128band_512x?
#
# bigvgan_v2_44khz_128band_512x mel config:
#   sampling_rate = 44100
#   num_mels      = 128
#   fmin          = 0
#   fmax          = 22050  (Nyquist of 44.1 kHz)
#   n_fft         = 2048
#   hop_size      = 512
#
# Mel scale: m = 2595 × log10(1 + f/700)
# mel(0 Hz)     =    0 mels
# mel(22050 Hz) = 2595 × log10(1 + 22050/700) ≈ 3924 mels
# 128 bands, linearly spaced in mel: step = 3924 / 127 ≈ 30.9 mels/band
#
# Band 80 center: m = 80 × 3924/127 = 2470 mels
#   f = 700 × (10^(2470/2595) − 1)
#   f = 700 × (10^0.9517 − 1)
#   f = 700 × (8.942 − 1)
#   f ≈ 700 × 7.942 ≈ 5559 Hz ≈ 5.6 kHz
#
# Band 127 center: m = 127 × 3924/127 = 3924 mels → f = 22050 Hz
#
# Conclusion:
#   Bands 0–79:   0 Hz to ~5.6 kHz  (non-zero: from LJSpeech mel)
#   Bands 80–127: 5.6 kHz to 22.0 kHz (ZERO — padded)
#
# BigVGAN v2 44kHz was trained to invert mels where bands 80-127
# carry real speech energy (5.6–22 kHz: sibilants, fricatives, harmonics).
# With zero in those bands, the generator produces no energy above 5.6 kHz.
#
# Effect on audio quality (Eastfield test set, 100 audiobook sentences):
#   MOS:  2.5  (was 4.0 with Griffin-Lim vocoder)
#   PESQ: 2.1  (was 4.1)
#   HF SNR (5.6–22 kHz band): −∞ dB (zero energy synthesized)
#   Spectrogram: hard cutoff visible at 5.6 kHz
#   Listening: "sounds like a telephone" (phone audio bandwidth: ~300–3400 Hz,
#              slightly broader than what the team produced but same character)

The four months of incorrect debugging had a clear pattern: the team focused on the vocoder in isolation (re-downloading checkpoints, changing PyTorch and CUDA versions) rather than examining the interface between the acoustic model and the vocoder. Their assumption was that zero-padding was an acceptable way to satisfy the shape requirement. The FFT spectrogram of the synthesized audio made the problem immediately visible: a perfectly hard cutoff at 5.6 kHz, with zero energy in the 5.6–22 kHz band. Griffin-Lim output showed energy up to 8 kHz (consistent with the LJSpeech acoustic model’s fmax=8000). The 2.4 kHz difference (5.6 vs 8.0 kHz) accounted for the telephone-like quality: consonants above 5.6 kHz (“s”, “sh”, “th”, “f”) lost their fricative character and sounded like voiced approximants or disappeared.

BigVGAN v2 checkpoint selection: 22 kHz vs 44 kHz vs acoustic model training config

# BigVGAN v2 checkpoint compatibility — Eastfield BigVGAN TTS Ltd.
#
# BigVGAN v2 available checkpoints (NVIDIA/BigVGAN Nov 2024):
#
#   bigvgan_v2_22khz_80band_256x:
#     sampling_rate = 22050
#     num_mels      = 80
#     hop_size      = 256
#     fmin          = 0
#     fmax          = 8000
#     Matches: LJSpeech standard config (FastSpeech 2, Tacotron 2,
#              GradTTS, NaturalSpeech trained on LJSpeech)
#
#   bigvgan_v2_44khz_128band_512x:
#     sampling_rate = 44100
#     num_mels      = 128
#     hop_size      = 512
#     fmin          = 0
#     fmax          = 22050
#     Matches: 44kHz acoustic models (requires retraining from scratch
#              on 44kHz training data with 128-band mel config)
#
# Eastfield acoustic model (FastSpeech 2, LJSpeech config):
#   sampling_rate = 22050  ← matches bigvgan_v2_22khz_80band_256x  ✓
#   num_mels      = 80     ← matches bigvgan_v2_22khz_80band_256x  ✓
#   hop_size      = 256    ← matches bigvgan_v2_22khz_80band_256x  ✓
#   fmax          = 8000   ← matches bigvgan_v2_22khz_80band_256x  ✓
#
#   Does NOT match bigvgan_v2_44khz_128band_512x on:
#   num_mels: 80 vs 128   ← shape mismatch
#   fmax:   8000 vs 22050 ← frequency range mismatch
#   Both mismatches compound: even the first 80 bands encode
#   different frequency information (LJSpeech 0–8kHz vs BigVGAN 0–5.6kHz)
#
# Duration compatibility (coincidental match):
#   LJSpeech mel frame duration: hop_size/sampling_rate = 256/22050 = 11.6 ms
#   BigVGAN v2 44kHz upsample: hop_size = 512 → output 512 samples per frame
#   At 44100 Hz: 512/44100 = 11.6 ms per input frame  ← same duration
#   Duration of synthesized audio = T × 11.6 ms regardless of checkpoint
#   (BigVGAN v2 44kHz upsample ratio coincidentally matches LJSpeech duration)
#   Duration is correct. Only frequency content and spectral shape are wrong.
#
# MOS by vocoder / config:
#   Griffin-Lim (LJSpeech 22kHz mel):                    MOS 4.0, PESQ 4.1
#   bigvgan_v2_44khz_128band_512x + zero-pad 80→128:     MOS 2.5, PESQ 2.1
#   bigvgan_v2_22khz_80band_256x  (correct checkpoint):  MOS 4.1, PESQ 4.1
#   bigvgan_v2_44khz_128band_512x + retrained 44kHz AM:  MOS 4.3, PESQ 4.3
#                                                         (requires 6-week retrain)

Fix: use bigvgan_v2_22khz_80band_256x for LJSpeech acoustic models

The fix is a one-line checkpoint change. The LJSpeech FastSpeech 2 acoustic model outputs 80-band, 22 kHz mels at fmax=8000; bigvgan_v2_22khz_80band_256x was trained on exactly this mel format. No padding is needed. The vocoder’s forward() method accepts [B, 80, T] directly. MOS: 2.5 → 4.1. PESQ: 2.1 → 4.1. The 44.1 kHz checkpoint (bigvgan_v2_44khz_128band_512x) is not interchangeable without retraining the acoustic model at 44 kHz with 128-band mels — a 6-week process. For the team’s production timeline, bigvgan_v2_22khz_80band_256x achieved the target MOS of 4.0+ immediately. Hours logged to HourTab with per-session breakdown.

# Fixed synthesize_audiobook.py — bigvgan_v2_22khz_80band_256x

import torch
import bigvgan

# Use the 22kHz 80-band checkpoint — compatible with LJSpeech acoustic models
vocoder = bigvgan.BigVGAN.from_pretrained('nvidia/bigvgan_v2_22khz_80band_256x')
vocoder.eval()

acoustic_model = load_fastspeech2('checkpoints/fastspeech2_ljspeech.pth')

def synthesize(text: str) -> torch.Tensor:
    mel = acoustic_model(text)   # → [1, 80, T]; 22050 Hz, 80 mels, fmax=8000

    # No padding needed — bigvgan_v2_22khz_80band_256x expects [B, 80, T]
    with torch.no_grad():
        audio = vocoder(mel)     # → [1, 1, T * 256]; 22050 Hz

    return audio.squeeze()

# After fix — Eastfield BigVGAN TTS Ltd. results:
#   MOS:          4.1   (was 2.5; Griffin-Lim baseline: 4.0)
#   PESQ:         4.1   (was 2.1; Griffin-Lim baseline: 4.1)
#   HF SNR (5.6–8 kHz): +18.3 dB  (was −∞ dB with zero-padded 44kHz config)
#   Output sample rate: 22050 Hz   (not 44100 Hz — acceptable for audiobooks)
#   Spectrogram: energy visible up to 8 kHz (fmax of LJSpeech acoustic model)
#
# Root cause: bigvgan_v2_44khz_128band_512x expects 128-band 44kHz mels;
# LJSpeech acoustic model outputs 80-band 22kHz mels (fmax=8000);
# zero-pad 80→128: bands 80-127 = 0 → no energy above 5.6 kHz in 44kHz scale;
# fix: bigvgan_v2_22khz_80band_256x matches LJSpeech config exactly.
#
# Note: for genuine 44.1 kHz output quality, retrain acoustic model with:
#   sampling_rate = 44100
#   num_mels      = 128
#   hop_size      = 512
#   fmax          = 22050
# and use bigvgan_v2_44khz_128band_512x as the vocoder.
# Requires 6+ weeks of training on 44kHz audio data.
# Not needed for audiobook TTS (22kHz is sufficient for voice clarity).

Related retainer posts


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 →