in src/lib/audio-streamer.ts [215:236]
stop() {
this.isPlaying = false;
this.isStreamComplete = true;
this.audioQueue = [];
this.scheduledTime = this.context.currentTime;
if (this.checkInterval) {
clearInterval(this.checkInterval);
this.checkInterval = null;
}
this.gainNode.gain.linearRampToValueAtTime(
0,
this.context.currentTime + 0.1
);
setTimeout(() => {
this.gainNode.disconnect();
this.gainNode = this.context.createGain();
this.gainNode.connect(this.context.destination);
}, 200);
}