From 283caba8ce0e874e1876e6ef83a8d380e83f985f Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Thu, 7 Nov 2024 18:57:57 +0800 Subject: [PATCH] stop streaming play after get input audio. --- app/components/realtime-chat/realtime-chat.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/components/realtime-chat/realtime-chat.tsx b/app/components/realtime-chat/realtime-chat.tsx index 2ea6d527e56..e9620cb39b9 100644 --- a/app/components/realtime-chat/realtime-chat.tsx +++ b/app/components/realtime-chat/realtime-chat.tsx @@ -202,7 +202,6 @@ export function RealtimeChat({ }; const handleInputAudio = async (item: RTInputAudioItem) => { - audioHandlerRef.current?.stopStreamingPlayback(); await item.waitForCompletion(); if (item.transcription) { const userMessage = createMessage({ @@ -226,6 +225,8 @@ export function RealtimeChat({ }); }); } + // stop streaming play after get input audio. + audioHandlerRef.current?.stopStreamingPlayback(); }; const toggleRecording = async () => {