Audio recorded from microphone is muted during the voice call

落花浮王杯 提交于 2019-12-04 16:55:21

I would not call this normal, but you're entering platform-specific behavior here. Recording with AudioSource.MIC during a voice call will work on some devices, but not on others.

Just to name a few reasons that I've run into myself for why this functionality might've been disabled:

  • Some platforms only supports capturing microphone audio at a single sample rate at any given time. And since voice calls take priority over anything else (this is a phone after all) and voice calls require either 8 or 16 kHz sample rate, the decision about what to do when you have a ongoing recording when a voice call starts might be to simply mute the recording, so that your recording isn't filled with 8 kHz data when your app thinks it's getting 44.1 kHz for example.

  • If you leave a recorder idle (stopped but not released) during a voice call some platforms could stop transferring audio data from the microphone, effectively muting the voice call uplink. To avoid this, the vendor might've just decided that a recording during a voice call won't actually be routed to any input device, but rather just be filled with zeroes.

Disclaimer: I have not worked with the Nexus S, so I don't know what the reason was on that specific device.

I believe this is normal behaviour, Audio data while CALL is connected will never be processed through Application processor on which Android is running. Usually the Audio chipset will switch it to stream coming from Modem.

In theory, you can get a feed from the call itself (http://stackoverflow.com/questions/4194342/how-can-i-record-voice-and-record-call-in-android), but most makers apparently don't support this.

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