From 0dd0d506f77e981258dad30e916c95daeb4aef13 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Wed, 13 Mar 2013 23:48:49 -0400 Subject: Work around two Firefox bugs --- src/library_openal.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/library_openal.js b/src/library_openal.js index 5215bfc3..11dc1ea1 100644 --- a/src/library_openal.js +++ b/src/library_openal.js @@ -86,8 +86,14 @@ var LibraryOpenAL = { var gain = AL.currentContext.ctx.createGain(); var panner = AL.currentContext.ctx.createPanner(); src.connect(gain); - gain.connect(panner); - panner.connect(AL.currentContext.ctx.destination); + if (typeof(webkitAudioContext) == 'function') { + gain.connect(panner); + panner.connect(AL.currentContext.ctx.destination); + } else { + // Work around a Firefox bug (bug 849916) + gain.connect(AL.currentContext.ctx.destination); + } + gain.gain.value = 1; // work around a Firefox bug (bug 850970) AL.currentContext.src.push({src: src, gain: gain, panner: panner}); {{{ makeSetValue('sources', 'i', 'AL.currentContext.src.length', 'i32') }}}; } -- cgit v1.2.3-18-g5258