fix(audio): pauseForCall setzt isPlaying zurueck — Playback nach Anruf nicht mehr tot
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) <noreply@anthropic.com>
This commit is contained in:
@@ -363,6 +363,10 @@ class AudioService {
|
|||||||
console.log('[Audio] pauseForCall: %s', reason || '(no reason)');
|
console.log('[Audio] pauseForCall: %s', reason || '(no reason)');
|
||||||
this._conversationFocusActive = false;
|
this._conversationFocusActive = false;
|
||||||
this._pausedForCall = true;
|
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
|
// Foreground-Service stoppen — Notification waere sonst irrefuehrend
|
||||||
stopBackgroundAudio().catch(() => {});
|
stopBackgroundAudio().catch(() => {});
|
||||||
// SoundPool/RNSound (Resume-Sound, Play-Button) stoppen — nicht relevant fuer Auto-Resume
|
// SoundPool/RNSound (Resume-Sound, Play-Button) stoppen — nicht relevant fuer Auto-Resume
|
||||||
@@ -778,8 +782,13 @@ class AudioService {
|
|||||||
if (!base64Data) return;
|
if (!base64Data) return;
|
||||||
// Mute-Flag respektieren — robust gegen Race-Conditions zwischen User-
|
// Mute-Flag respektieren — robust gegen Race-Conditions zwischen User-
|
||||||
// Klick auf Mute und einem TTS-Chunk der im selben Tick eintrifft.
|
// 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);
|
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) {
|
if (!this.isPlaying) {
|
||||||
this._playNext();
|
this._playNext();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user