From 632e1e4fa12d736e921550aacb2103cc5d3ac991 Mon Sep 17 00:00:00 2001 From: duffyduck Date: Sun, 10 May 2026 16:28:42 +0200 Subject: [PATCH] =?UTF-8?q?fix(audio):=20pauseForCall=20setzt=20isPlaying?= =?UTF-8?q?=20zurueck=20=E2=80=94=20Playback=20nach=20Anruf=20nicht=20mehr?= =?UTF-8?q?=20tot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pauseForCall stoppte zwar currentSound + setzte ihn auf null, hat aber isPlaying=true gelassen. Folge: nach dem Anruf war jeder weitere Play- Button-Klick wirkungslos, weil playAudio bei isPlaying=true den _playNext-Pfad ueberspringt. Co-Authored-By: Claude Opus 4.7 (1M context) --- android/src/services/audio.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/android/src/services/audio.ts b/android/src/services/audio.ts index 3d8c06b..5cee4e2 100644 --- a/android/src/services/audio.ts +++ b/android/src/services/audio.ts @@ -363,6 +363,10 @@ class AudioService { console.log('[Audio] pauseForCall: %s', reason || '(no reason)'); this._conversationFocusActive = false; this._pausedForCall = true; + // Queue + isPlaying ruecksetzen — sonst klemmt der naechste Play-Button + // (playAudio sieht isPlaying=true und ruft _playNext nicht mehr auf). + this.audioQueue = []; + this.isPlaying = false; // Foreground-Service stoppen — Notification waere sonst irrefuehrend stopBackgroundAudio().catch(() => {}); // SoundPool/RNSound (Resume-Sound, Play-Button) stoppen — nicht relevant fuer Auto-Resume @@ -778,8 +782,13 @@ class AudioService { if (!base64Data) return; // Mute-Flag respektieren — robust gegen Race-Conditions zwischen User- // Klick auf Mute und einem TTS-Chunk der im selben Tick eintrifft. - if (this._muted) return; + if (this._muted) { + console.log('[Audio] playAudio: muted=true → skip'); + return; + } this.audioQueue.push(base64Data); + console.log('[Audio] playAudio: queued (queue=%d isPlaying=%s pausedForCall=%s)', + this.audioQueue.length, this.isPlaying, this._pausedForCall); if (!this.isPlaying) { this._playNext(); }