diff --git a/src/ratatoskr/tts.py b/src/ratatoskr/tts.py index e98492d..6be3030 100644 --- a/src/ratatoskr/tts.py +++ b/src/ratatoskr/tts.py @@ -14,6 +14,7 @@ Foot-guns (verified live 2026-08-02): from __future__ import annotations +import struct from collections.abc import Mapping from dataclasses import dataclass @@ -97,6 +98,27 @@ class EmotionDials: } +def _finalize_wav_header(data: bytes) -> bytes: + """Rewrite the RIFF + data chunk sizes with the real byte counts. + + The Zonos gateway emits a STREAMING wav header — the RIFF chunk size (offset 4) + and the data chunk size are both 0xFFFFFFFF ("unknown length"), because it can + stream. A browser