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