Issue #3597581 by banoodle: Fix audio truncated to the first chunk when text...

Issue #3597581 by banoodle: Fix audio truncated to the first chunk when text exceeds 5000 characters

Each ElevenLabs response is a complete MP3 file with its own ID3 tag and Xing/Info header frame declaring that segment's duration. Appending the responses byte for byte left the first segment's Xing header at the front of the joined file, so players reported and played only that segment while the remaining audio sat unreachable in the file.

Strip the per-segment ID3 tags and the Xing/Info/VBRI header frame from each response and join the bare MPEG frames instead.

Also rewrite the text splitter, which ran words together where it rejoined wrapped lines, could emit an empty chunk that was then POSTed to the API, never split a token longer than the limit, and counted bytes rather than characters. Drop the log line that wrote the full source text to watchdog on every request.

Closes #3597581

AI (Claude) was used to assist in creating these changes, but I tested them end-to-end on a real project.

Merge request reports

Loading