diff options
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r-- | src/library_sdl.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index 3851caaf..e8c4b6b8 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -1578,6 +1578,9 @@ var LibrarySDL = { } // Allocate new sound buffer to be played. var source = SDL.audioContext['createBufferSource'](); + if (SDL.audio.soundSource[SDL.audio.nextSoundSource]) { + SDL.audio.soundSource[SDL.audio.nextSoundSource]['disconnect'](); + } SDL.audio.soundSource[SDL.audio.nextSoundSource] = source; source.buffer = SDL.audioContext['createBuffer'](SDL.audio.channels,sizeSamplesPerChannel,SDL.audio.freq); SDL.audio.soundSource[SDL.audio.nextSoundSource]['connect'](SDL.audioContext['destination']); |