src/audio/emscripten/SDL_emscriptenaudio.c
changeset 10276 470698f90685
parent 10274 cc6461b9c5bc
child 10281 2a002e96888f
equal deleted inserted replaced
10275:757db914bde0 10276:470698f90685
   354             var silence_callback = function() {
   354             var silence_callback = function() {
   355                 SDL2.capture.currentCaptureBuffer = SDL2.capture.silenceBuffer;
   355                 SDL2.capture.currentCaptureBuffer = SDL2.capture.silenceBuffer;
   356                 Runtime.dynCall('vi', $2, [$3]);
   356                 Runtime.dynCall('vi', $2, [$3]);
   357             };
   357             };
   358 
   358 
   359             SDL2.capture.silenceTimer = setTimeout(silence_callback, $1 / SDL2.audioContext.sampleRate);
   359             SDL2.capture.silenceTimer = setTimeout(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000);
   360 
   360 
   361             if ((navigator.mediaDevices !== undefined) && (navigator.mediaDevices.getUserMedia !== undefined)) {
   361             if ((navigator.mediaDevices !== undefined) && (navigator.mediaDevices.getUserMedia !== undefined)) {
   362                 navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(have_microphone).catch(no_microphone);
   362                 navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(have_microphone).catch(no_microphone);
   363             } else if (navigator.webkitGetUserMedia !== undefined) {
   363             } else if (navigator.webkitGetUserMedia !== undefined) {
   364                 navigator.webkitGetUserMedia({ audio: true, video: false }, have_microphone, no_microphone);
   364                 navigator.webkitGetUserMedia({ audio: true, video: false }, have_microphone, no_microphone);