From 5d776d7e17857c5be78a6503236605a6a3057c93 Mon Sep 17 00:00:00 2001 From: Jan Willem Logemann Date: Sat, 25 Apr 2015 19:37:45 +0200 Subject: [PATCH] moved the getusermedia call to the startRecording function I moved the call to getusermedia to the startrecording function. This is to prevent the page form asking for permission to use your microphone as soon as it finishes loading. --- example_simple_exportwav.html | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/example_simple_exportwav.html b/example_simple_exportwav.html index d3482d2b..6eec2d55 100644 --- a/example_simple_exportwav.html +++ b/example_simple_exportwav.html @@ -16,8 +16,8 @@

Recorder.js simple WAV export example

Make sure you are using a recent version of Google Chrome.

Also before you enable microphone input either plug in headphones or turn the volume down if you want to avoid ear splitting feedback!

- - + +

Recordings

@@ -43,13 +43,16 @@

Log

recorder = new Recorder(input); __log('Recorder initialised.'); + recorder && recorder.record(); + document.getElementById('start').disabled = true; + document.getElementById('stop').disabled = false; + __log('Recording...'); } function startRecording(button) { - recorder && recorder.record(); - button.disabled = true; - button.nextElementSibling.disabled = false; - __log('Recording...'); + navigator.getUserMedia({audio: true}, startUserMedia, function(e) { + __log('No live audio input: ' + e); + }); } function stopRecording(button) { @@ -95,10 +98,6 @@

Log

} catch (e) { alert('No web audio support in this browser!'); } - - navigator.getUserMedia({audio: true}, startUserMedia, function(e) { - __log('No live audio input: ' + e); - }); };