Skip to content

Commit d8e9b37

Browse files
authored
Merge pull request #15 from Gabry848/fix/reduce-turn-delay
perf: reduce inter-turn delays for faster voice chat response
2 parents 3339e5f + cabe9b8 commit d8e9b37

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/hooks/useVoiceChat.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export function useVoiceChat() {
117117
shouldAutoStartRecordingRef.current = false;
118118
setTimeout(() => {
119119
startRecording();
120-
}, 500);
120+
}, 150);
121121
} else if (isMutedRef.current) {
122122
shouldAutoStartRecordingRef.current = false;
123123
}
@@ -235,7 +235,7 @@ export function useVoiceChat() {
235235
if (audioRecorderRef.current && websocketRef.current?.isReady()) {
236236
startRecording();
237237
}
238-
}, 300);
238+
}, 100);
239239
}
240240
} else {
241241
console.log(`[useVoiceChat] Audio in corso (chunks: ${audioPlayerRef.current?.getChunksCount() || 0}, playing: ${isPlaying}), mantengo mute fino a fine riproduzione`);
@@ -264,7 +264,7 @@ export function useVoiceChat() {
264264
if (audioRecorderRef.current && websocketRef.current?.isReady()) {
265265
startRecording();
266266
}
267-
}, 300);
267+
}, 100);
268268
}
269269
} else {
270270
// Agent non ha ancora finito, torna in processing
@@ -288,7 +288,7 @@ export function useVoiceChat() {
288288
if (audioRecorderRef.current && websocketRef.current?.isReady()) {
289289
startRecording();
290290
}
291-
}, 300);
291+
}, 100);
292292
}
293293
}
294294
break;
@@ -313,7 +313,7 @@ export function useVoiceChat() {
313313
if (audioRecorderRef.current && websocketRef.current?.isReady()) {
314314
startRecording();
315315
}
316-
}, 200);
316+
}, 100);
317317
}
318318
break;
319319
}

0 commit comments

Comments
 (0)