Explorar o código

Fix soundSource being lost

David Catuhe %!s(int64=5) %!d(string=hai) anos
pai
achega
c545104fa1
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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);