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(() => {});
|
if (this.preloadedPath) RNFS.unlink(this.preloadedPath).catch(() => {});
|
||||||
this.preloadedPath = '';
|
this.preloadedPath = '';
|
||||||
}
|
}
|
||||||
// PCM-Stream ebenfalls hart stoppen (Cancel/Abbruch)
|
// PCM-Stream ebenfalls hart stoppen (Cancel/Abbruch).
|
||||||
if (this.pcmStreamActive) {
|
// pcmStreamActive wird beim isFinal-Chunk schon false gesetzt — der
|
||||||
PcmStreamPlayer?.stop().catch(() => {});
|
// AudioTrack spielt aber noch sekundenlang aus seinem Buffer ab. Daher
|
||||||
this.pcmStreamActive = false;
|
// IMMER stop() aufrufen, ohne den Flag zu pruefen (ist idempotent).
|
||||||
this.pcmBuffer = [];
|
PcmStreamPlayer?.stop().catch(() => {});
|
||||||
this.pcmBytesCollected = 0;
|
this.pcmStreamActive = false;
|
||||||
this.pcmMessageId = '';
|
this.pcmBuffer = [];
|
||||||
}
|
this.pcmBytesCollected = 0;
|
||||||
|
this.pcmMessageId = '';
|
||||||
// Audio-Focus sofort freigeben — User hat explizit abgebrochen
|
// Audio-Focus sofort freigeben — User hat explizit abgebrochen
|
||||||
this._cancelDeferredFocusRelease();
|
this._cancelDeferredFocusRelease();
|
||||||
AudioFocus?.release().catch(() => {});
|
AudioFocus?.release().catch(() => {});
|
||||||
|
|||||||
Reference in New Issue
Block a user