Question

I feel like maybe something has changed in Chrome as there are demos of this functionality out there that don't seem to work anymore. I haven't found anything saying so though. Here is my code:

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);
    });
};

I can't get the audio to play through the speakers. I'm hoping that my code is just incorrect and that this is still possible. I can get it to work if I use an audio tag and send it straight there but I want to be able to add filters to it.

Was it helpful?

Solution 2

It looks like I needed to change my microphone to default. It was set on display audio.enter image description here

OTHER TIPS

You have made a typographical error. Your first line should be

navigator.getUserMedia = ( navigator.getUserMedia    || navigator.webkitGetUserMedia ||
                           navigator.mozGetUserMedia ||navigator.msGetUserMedia);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top