问题
it is possible to access different microphones at the same time using getUserMedia()
?
This whould be useful to
- filter out background noise;
- create some sort of stereoscopic effect;
- make available multiple audio tracks for an international streaming conference.
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.
回答1:
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.
来源:https://stackoverflow.com/questions/28582017/recording-audio-from-multiple-microphones-simultaneously-with-getusermedia