```
fix: improve audio playback interruption and response persistence - Remove TTS timeout to prevent premature playback cancellation - Save assistant responses to history before waiting for TTS completion - Stop audio playback when sending message or starting recording - Properly reject current audio promise when stopping playback - Ensure partial responses are saved even if stream is aborted ```
This commit is contained in:
@@ -248,6 +248,10 @@ function App() {
|
||||
const handleSendMessage = () => {
|
||||
if (!userInput.trim() || !ws.isConnected) return;
|
||||
|
||||
// Stop any currently playing audio and clear the queue
|
||||
audioPlayerRef.current.stop();
|
||||
setIsPlayingAudio(false);
|
||||
|
||||
// Send message to server
|
||||
ws.sendUserMessage(userInput);
|
||||
|
||||
@@ -292,6 +296,11 @@ function App() {
|
||||
console.log(`[App] Sent audio: ${audioBlob.size} bytes, format: ${format}`);
|
||||
} else {
|
||||
console.log('[App] Starting recording...');
|
||||
|
||||
// Stop any currently playing audio when starting to record
|
||||
audioPlayerRef.current.stop();
|
||||
setIsPlayingAudio(false);
|
||||
|
||||
await recorder.start();
|
||||
setIsRecording(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user