I've been playing around a lot with HTML5, but I can't get the following done.
The javascript has to ask permission to access the microphone, and then it has to stream the microphone input to the computer speakers.
This is the javascript I had:
navigator.getUserMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||navigator.msGetUserMedia);
var aCtx;
var analyser;
var microphone;
if (navigator.getUserMedia) {
navigator.getUserMedia({audio: true}, function(stream) {
aCtx = new webkitAudioContext();
analyser = aCtx.createAnalyser();
microphone = aCtx.createMediaStreamSource(stream);
microphone.connect(analyser);
analyser.connect(aCtx.destination);
});
};
But Chrome (and Opera) say
Uncaught TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': 3 arguments required, but only 2 present.
Why would it need more arguments?
Can anyone please help me with the javascript for this?
Thanks.