[BugFix] qwen3_tts chunk boundary handling logic in initial chunk (IC) (#2378)

Signed-off-by: Fattysand <fattysand@users.noreply.github.com>
This commit is contained in:
fattysand authored and GitHub committed 2026-04-01 09:40:12 +08:00
1 parent dd0b6fd4e8
commit 7274e15840
2 files changed
+42 -13

No files matched your search

@@ -212,7 +212,7 @@ def talker2code2wav_async_chunk(
}
return None
in_initial_phase = initial_chunk_size > 0 and initial_chunk_size < chunk_size and length < chunk_size
in_initial_phase = initial_chunk_size > 0 and initial_chunk_size < chunk_size and length <= chunk_size
if in_initial_phase:
# IC phase: emit every initial_chunk_size frames with growing left context.
@@ -225,7 +225,7 @@ def talker2code2wav_async_chunk(
# Normal phase: offset so the first normal emit picks up after IC phase.
# IC is stateless (may change with load); any mismatch is absorbed by left_context.
initial_coverage = (
((chunk_size - 1) // initial_chunk_size) * initial_chunk_size if 0 < initial_chunk_size < chunk_size else 0
(chunk_size // initial_chunk_size) * initial_chunk_size if 0 < initial_chunk_size < chunk_size else 0
)
adjusted = length - initial_coverage
if not finished and adjusted % chunk_size != 0: