Skip to content

Higgs Audio v3: condition on a tail-prepared reference to stop end-of-clip hiss - #14563

Merged
niksedk merged 1 commit into
mainfrom
claude/end-noises-analysis-retest-37142c
Sep 5, 2026
Merged

Higgs Audio v3: condition on a tail-prepared reference to stop end-of-clip hiss#14563
niksedk merged 1 commit into
mainfrom
claude/end-noises-analysis-retest-37142c

Conversation

@niksedk

@niksedk niksedk commented Sep 5, 2026

Copy link
Copy Markdown
Member

Follow-up to #14546 and the "end noises" still heard after it (also the 60 % estimate in #14480 comment).

What the re-test found

Re-tested on the shipped 2026-09-05 audio.cpp build (Metal, Q8_0) with an instrumented local build of the same commit:

  • The More refact in Utilities #454 codec fix works as designed. On identical seeded codes, no tail context vs 8 frames drops the last frame by 8-12 dB, and 64 frames of context gives the same samples (max diff 0.005). Nothing more to gain there.
  • The remaining hiss is in the codes, not the codec. Holding the final frame's codes for 8 extra frames decodes to a steady hiss at the same level (-26 to -35 dBFS), so the language model itself emits noise codes in its last 5-7 frames before the end-of-audio token. The raw codes carry no stray BOC/EOC, the delayed tail is the normal EOC staircase, and sglang-omni's reference sampler has the identical delay/EOC state machine. Temperature/top-k/top-p changes do not help.
  • What decides it is how the reference clip ends. The model continues the reference in context and ends its own clip the same way. Sophie_Anderson.wav ends at -19 dBFS mid-noise and every clip from it ended hissy; female_06.wav ends at -83 dBFS and its clips ended clean.

Fix

CloneReferenceTail.PrepareAsync makes a cached copy of the reference (voices/prepared/<name>.wav, keyed on size + mtime + recipe version): trailing silence/noise trimmed at the pipeline's peak-relative threshold, 50 ms fade-out, 400 ms of digital silence appended, 24 kHz mono. Higgs Speak conditions on that copy; the transcript is still read from the original's .txt. Falls back to the original when ffmpeg is missing or fails.

Seeded A/B, 48 clips per treatment (4 voices × 12 seeds, same seeds per column), level of the loudest of the last four codec frames:

reference median loud endings (> -40 dBFS)
as is -46.3 dBFS 18 / 48
trim only -55.8 dBFS 5 / 48
trim + fade + pad (this PR) -64.3 dBFS 3 / 48

No runaway generations in 192 prepared-reference requests. The remaining loud endings are Morgan Freeman's clip, whose own room tone the model copies. Pad without fade was rejected: an abrupt cut followed by silence made the model emit one loud burst before its silence.

Also retries once on audio.cpp's Higgs TTS generation reached max_tokens before EOC (one in ~370 requests observed; no seed is sent so the retry samples afresh), which previously failed the segment outright.

Tests

  • Parameter builder: filter order (trim and fade on the reversed signal, pad after), invariant formatting, clamping.
  • CloneReferenceTail: prepared path, stamp, cache reuse, missing-reference fallback, runaway-error matcher.
  • ffmpeg-backed: real preparation of a synthetic tone + noise-tail clip: noise tail gone, 400 ms of zero samples appended, fade before the pad, second call reuses the copy.

🤖 Generated with Claude Code

…-clip hiss

After the codec-side fix (audio.cpp #454, SE PR #14546) Higgs clips still
ended in a rising broadband hiss in roughly half of all generations. Decoding
identical seeded codes with 8 or 64 frames of tail context gave the same
samples, and holding the final frame's codes decoded to a steady hiss at the
same level, so the noise is in the codes the language model emits, not in the
codec. What decides it is the reference WAV: the model ends its clip the way
the reference ends. References cut mid-noise or ending in room tone gave hissy
endings; references ending in silence gave clean ones.

Speak now conditions on a cached copy of the reference whose tail is trimmed
at the pipeline's peak-relative threshold, faded out over 50 ms and followed by
400 ms of digital silence (CloneReferenceTail, prepared/<name>.wav next to the
voice, keyed on size + mtime + recipe version). On 48 seeded clips per
treatment the median level of the last four frames went from -46 dBFS to
-64 dBFS and loud endings from 18 to 3, with no runaway generations in 192
requests. Preparation is best-effort and falls back to the file as is.

Also retries once when audio.cpp reports "reached max_tokens before EOC"
(one runaway in ~370 requests; no seed is sent so the retry samples afresh).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@niksedk
niksedk merged commit 26b6b38 into main Sep 5, 2026
1 check passed
@niksedk
niksedk deleted the claude/end-noises-analysis-retest-37142c branch September 5, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant