leonard vertighel
leonard vertighel

Reputation: 1068

Recording audio from multiple microphones simultaneously with getUserMedia()

it is possible to access different microphones at the same time using getUserMedia()?

This whould be useful to

Apparently, it is quite tricky for video source: Capture video from several webcams with getUserMedia

I was wondering if, for the audio source, the problem was different.

Upvotes: 11

Views: 2843

Answers (1)

michael
michael

Reputation: 4483

You should be able to do this but I imagine the browser support will let you down somewhere along the line.

You should be able to create several media sources by specifying a microphone ID when using getUserMedia. You can find the IDs of all connected media devices using MediaDevices.enumerateDevices()

Once you have two separate microphone inputs you should be able to get the data using an AudioContext.

Then it's a case of doing what ever you're doing to the bit data before it's output to the browser.

This is all very high level and the details of the actual implementation would probably take quite a long time to figure out but as for your question: Yes, it should be possible if browser support is there.

Upvotes: 1

Related Questions