From abdcecc75ebd5ee119a1569b693a553655a4c2ec Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Thu, 15 Jun 2023 16:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/audio/sound.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/audio/sound.ts b/src/core/audio/sound.ts index 107c722..b7bb1c4 100644 --- a/src/core/audio/sound.ts +++ b/src/core/audio/sound.ts @@ -23,6 +23,7 @@ export class SoundEffect extends AudioPlayer { const index = this.playMap.get(node); if (!index) return; delete this.playing[index]; + this.playMap.delete(node); }); this.on('update', () => { this.initAudio(this.stereo); @@ -39,6 +40,8 @@ export class SoundEffect extends AudioPlayer { const channel = this.buffer?.numberOfChannels; const ac = AudioPlayer.ac; if (!channel) return; + this.panner = null; + this.merger = null; if (stereo) { this.panner = ac.createPanner(); this.panner.connect(this.gain); @@ -80,6 +83,7 @@ export class SoundEffect extends AudioPlayer { v.stop(); }); this.playing = {}; + this.playMap.clear(); this._stopingAll = false; }