Skip to content

Commit

Permalink
emscripten audio: fix timer on capture's silence callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 10, 2016
1 parent 7a8e4cb commit 244d2db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/audio/emscripten/SDL_emscriptenaudio.c
Expand Up @@ -356,7 +356,7 @@ Emscripten_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
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);
Expand Down

0 comments on commit 244d2db

Please sign in to comment.