fix(audio): Mute-Button stoppt jetzt auch laufenden PCM-Stream
pcmStreamActive wurde beim isFinal-Chunk schon auf false gesetzt, der AudioTrack spielte aber noch aus seinem Buffer (kann sekundenlang sein). stopPlayback() uebersprang darum PcmStreamPlayer.stop() — ARIA redete weiter obwohl Spotify schon resumed war. Fix: stop() immer rufen, der Flag-Check faellt weg (ist eh idempotent). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1098,14 +1098,15 @@ class AudioService {
|
||||
if (this.preloadedPath) RNFS.unlink(this.preloadedPath).catch(() => {});
|
||||
this.preloadedPath = '';
|
||||
}
|
||||
// PCM-Stream ebenfalls hart stoppen (Cancel/Abbruch)
|
||||
if (this.pcmStreamActive) {
|
||||
PcmStreamPlayer?.stop().catch(() => {});
|
||||
this.pcmStreamActive = false;
|
||||
this.pcmBuffer = [];
|
||||
this.pcmBytesCollected = 0;
|
||||
this.pcmMessageId = '';
|
||||
}
|
||||
// PCM-Stream ebenfalls hart stoppen (Cancel/Abbruch).
|
||||
// pcmStreamActive wird beim isFinal-Chunk schon false gesetzt — der
|
||||
// AudioTrack spielt aber noch sekundenlang aus seinem Buffer ab. Daher
|
||||
// IMMER stop() aufrufen, ohne den Flag zu pruefen (ist idempotent).
|
||||
PcmStreamPlayer?.stop().catch(() => {});
|
||||
this.pcmStreamActive = false;
|
||||
this.pcmBuffer = [];
|
||||
this.pcmBytesCollected = 0;
|
||||
this.pcmMessageId = '';
|
||||
// Audio-Focus sofort freigeben — User hat explizit abgebrochen
|
||||
this._cancelDeferredFocusRelease();
|
||||
AudioFocus?.release().catch(() => {});
|
||||
|
||||
Reference in New Issue
Block a user