Commit adf7560
committed
fix: Use audio duration instead of chunk count for playback buffer threshold
- Changed hasSufficientBuffer() to check bytes instead of chunk count
- Fixes issue where x.ai (and potentially other providers) send larger audio chunks
- Previously waited for 6 chunks which could mean 3+ seconds with large chunks
- Now waits for 60ms of audio data (2880 bytes at 24kHz) regardless of chunk size
- This ensures consistent playback start timing across all providers1 parent 0a7e105 commit adf7560
1 file changed
Lines changed: 8 additions & 3 deletions
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
380 | | - | |
381 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
382 | 387 | | |
383 | 388 | | |
384 | 389 | | |
| |||
0 commit comments