You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(tts): add --tts-pad-silence-ms to circumvent VLC C2PA buffer drop
This introduces `tts_pad_silence_ms` to the TTS pipeline to inject pure
silence frames at the head of the audio before writing to file or
handing back via the ABI.
VLC drops the initial ~1.5 seconds of streaming playback when reading a
file containing a massive C2PA manifest (often 2-3KB appended at the end
of a WAV file). Padding the audio stream directly ensures VLC only drops
the padded silence, preserving the actual spoken speech while leaving the
cryptographic provenance manifest intact.
This is exposed to all ABI integrations via
`crispasr_session_set_tts_pad_silence_ms(session, ms)` and the HTTP API
as `"pad_silence_ms"`. For streaming ABI paths, the padding is only
applied to the first chunk to avoid accumulating inter-sentence latency.
/// <summary>Pad N ms of silence at the beginning of TTS output. Useful to bypass VLC playback bugs where it drops the first ~1.5s of audio while parsing a large C2PA chunk.</summary>
/** Pad N ms of silence at the beginning of TTS output. Useful to bypass VLC playback bugs where it drops the first ~1.5s of audio while parsing a large C2PA chunk. */
Copy file name to clipboardExpand all lines: docs/tts.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1843,6 +1843,12 @@ Build the library for the target with `-DCRISPASR_C2PA_FETCH=ON`:
1843
1843
(all modern browsers, 2023+). Only needed for`c2paSign(bytes, "audio/mpeg")`
1844
1844
and other non-WAV containers in the browser.
1845
1845
1846
+
**VLC Playback Bug (Silence Padding).** Because the C2PAJUMBF metadata chunk is extremely large (often 2-3KB), some audio players (notably **VLC**) stall their playback thread for~1.5 seconds while parsing it from the end of the file before playing the stream. For short TTS clips, this causes the first 1-2 seconds of the generated speech to be silently dropped during playback.
1847
+
To work around thiswhile keeping the C2PA metadata intact, you can explicitly pad silence frames at the beginning of the audio. By the time the player unblocks, the silence has played out and the speech begins unharmed.
0 commit comments