Stream TTS audio to caller in real-time chunks
TTS audio was sent as a single huge WebSocket frame that overflowed the browser's 3s ring buffer. Now streams in 60ms chunks at real-time rate. Also increased browser ring buffer from 3s to 10s as safety net. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -78,7 +78,7 @@ registerProcessor('caller-processor', CallerProcessor);
|
||||
class PlaybackProcessor extends AudioWorkletProcessor {
|
||||
constructor() {
|
||||
super();
|
||||
this.ringSize = 16000 * 3; // 3s ring buffer at 16kHz
|
||||
this.ringSize = 16000 * 10; // 10s ring buffer at 16kHz
|
||||
this.ring = new Float32Array(this.ringSize);
|
||||
this.writePos = 0;
|
||||
this.readPos = 0;
|
||||
|
||||
Reference in New Issue
Block a user