diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-05-29 19:04:12 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-05-29 19:04:12 -0700 |
commit | c0b86864ab8ae7ed9367e9e8db2886f064879443 (patch) | |
tree | 69a92c8212a84a7c0c4e5a9e905ffa3dbf9dc323 | |
parent | 0c6544c96189b1c492fa49fe553e230ecd7eedcb (diff) |
SDL audio fixes for closure compiler
-rw-r--r-- | src/library_sdl.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index 1c1898d1..8c7667ba 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -378,14 +378,14 @@ mergeInto(Library, { // Mozilla Audio API. TODO: Other audio APIs try { SDL.audio.mozOutput = new Audio(); - SDL.audio.mozOutput.mozSetup(SDL.audio.channels, SDL.audio.freq); + SDL.audio.mozOutput['mozSetup'](SDL.audio.channels, SDL.audio.freq); // use string attributes on mozOutput for closure compiler SDL.audio.mozBuffer = new Float32Array(totalSamples); SDL.audio.pushAudio = function(ptr, size) { var mozBuffer = SDL.audio.mozBuffer; for (var i = 0; i < totalSamples; i++) { mozBuffer[i] = ({{{ makeGetValue('ptr', 'i*2', 'i16') }}} / 65536)-1; // hardcoded 16-bit audio } - SDL.audio.mozOutput.mozWriteAudio(mozBuffer); + SDL.audio.mozOutput['mozWriteAudio'](mozBuffer); } } catch(e) { SDL.audio = null; |