Skip to content

Commit

Permalink
stop streaming play after get input audio.
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Nov 7, 2024
1 parent b78e5db commit 283caba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/components/realtime-chat/realtime-chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ export function RealtimeChat({
};

const handleInputAudio = async (item: RTInputAudioItem) => {
audioHandlerRef.current?.stopStreamingPlayback();
await item.waitForCompletion();
if (item.transcription) {
const userMessage = createMessage({
Expand All @@ -226,6 +225,8 @@ export function RealtimeChat({
});
});
}
// stop streaming play after get input audio.
audioHandlerRef.current?.stopStreamingPlayback();
};

const toggleRecording = async () => {
Expand Down

0 comments on commit 283caba

Please sign in to comment.