Recording audio from multiple microphones simultaneously with getUserMedia()

本秂侑毒 提交于 2019-12-06 21:50:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!