emscripten audio: fix timer on capture's silence callback.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 10 Aug 2016 14:13:48 -0400
changeset 10258 470698f90685
parent 10257 757db914bde0
child 10259 230c0df1e152
emscripten audio: fix timer on capture's silence callback.
src/audio/emscripten/SDL_emscriptenaudio.c
--- a/src/audio/emscripten/SDL_emscriptenaudio.c	Tue Aug 09 19:35:46 2016 -0400
+++ b/src/audio/emscripten/SDL_emscriptenaudio.c	Wed Aug 10 14:13:48 2016 -0400
@@ -356,7 +356,7 @@
                 Runtime.dynCall('vi', $2, [$3]);
             };
 
-            SDL2.capture.silenceTimer = setTimeout(silence_callback, $1 / SDL2.audioContext.sampleRate);
+            SDL2.capture.silenceTimer = setTimeout(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000);
 
             if ((navigator.mediaDevices !== undefined) && (navigator.mediaDevices.getUserMedia !== undefined)) {
                 navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(have_microphone).catch(no_microphone);