Fix audio placeholder length mismatch for merged audio inputs

#19
No description provided.
This comment has been hidden (marked as Resolved)
OpenBMB org

@cherry77-cloud
Thanks for the detailed report and repro script — really appreciate the thorough investigation.

I think the issue here isn't a code bug, but rather that merge_audio_from_same_content=True may not be the right fit for this use case.

This parameter was designed for simplex omni streaming, where inputs are fixed 1-second audio chunks. At 16kHz, 1s = 16000 samples divides cleanly by hop_length=160, so F(16000) + F(16000) = F(32000) — the placeholder and embedding counts always align.

In your case, each audio clip is 33440 samples, which doesn't divide evenly by 160. That introduces a rounding mismatch: F(33440) + F(33440) ≠ F(66880), giving 42 placeholders but only 41 embeddings from the merged waveform.

Simply switching to merge_audio_from_same_content=False should resolve it — in that mode both placeholder calculation and audio encoding process each clip independently, so they'll always match. No code changes needed.

Hope that helps!

cherry77-cloud changed pull request status to closed

@tc-mb 。thank you so much!
You're absolutely right — this isn't a bug at all, and I should have read the
documentation more carefully before filing the report.

Really appreciate your patience and the detailed breakdown.

Sign up or log in to comment