aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorILOVEPIE <thehairyrock@gmail.com>2013-03-18 20:50:49 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-09-24 16:56:18 -0700
commitabeaac2b2c9560cfb6cd6f00249e098ad733cc0e (patch)
tree84d73883870982e41d9eb67855f07ddfc4f35980
parent85462ceea11bdf2a068211797199dabe2bef7135 (diff)
Made the WebAudioAPI support slightly more efficient by removing some unnecessary channels.
Signed-off-by: ILOVEPIE <thehairyrock@gmail.com>
-rw-r--r--src/library_sdl.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index a7480afc..c5bbb989 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -1507,11 +1507,11 @@ var LibrarySDL = {
SDL.audio.context = new webkitAudioContext();
}
SDL.audio.pushAudio=function(ptr,size){
- SDL.audio.soundSource = SDL.audio.context.createBufferSource(SDL.audio.channels,SDL.audio.samples,SDL.audio.freq);
+ SDL.audio.soundSource = SDL.audio.context.createBufferSource(1,SDL.audio.samples,SDL.audio.freq);
if(typeof(SDL.audio.context.createScriptProcessor) === "function"){
- SDL.audio.soundInjector = SDL.audio.context.createScriptProcessor(SDL.audio.samples,SDL.audio.channels,SDL.audio.channels);
+ SDL.audio.soundInjector = SDL.audio.context.createScriptProcessor(SDL.audio.samples,1,SDL.audio.channels);
}else{
- SDL.audio.soundInjector = SDL.audio.context.createJavaScriptNode(SDL.audio.samples,SDL.audio.channels,SDL.audio.channels);
+ SDL.audio.soundInjector = SDL.audio.context.createJavaScriptNode(SDL.audio.samples,1,SDL.audio.channels);
}
SDL.audio.soundInjector.onaudioprocess = function(e) {
SDL.audio.webAudioFunc(SDL.audio.buffer,e);