From 54fef0e9d8ceb70d5b2cb6a345d720864bba73c9 Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Sat, 25 Apr 2026 14:50:29 -0700 Subject: [PATCH] stacks/index-tts: add streaming WAV endpoint (wrapper 0.2.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IndexTTS-2's tts.infer(stream_return=True) is a generator that yields audio chunks per text segment as they finish, plus inter-segment silence. Expose this via the existing POST /v1/audio/speech with a new "stream": true field on the request body. Wire-up: - 44-byte WAV header emitted up front with placeholder data length (0xFFFFFFFF) so chunks can be written before total samples are known. Players that read until EOF (mpv, ffplay, aplay, sox, browsers via