فهرست منبع

Fix soundSource being lost

David Catuhe 5 سال پیش
والد
کامیت
c545104fa1
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      src/Audio/sound.ts

+ 4 - 0
src/Audio/sound.ts

@@ -746,6 +746,10 @@ export class Sound {
                             length = length || this._length;
                             offset = offset || this._offset;
 
+                            if (this._soundSource) {
+                                this._soundSource.stop();
+                            }
+
                             this._soundSource = Engine.audioEngine.audioContext.createBufferSource();
                             this._soundSource.buffer = this._audioBuffer;
                             this._soundSource.connect(this._inputAudioNode);