Unable to access microphone when another app is using it in Android

前端 未结 2 1128
无人及你
无人及你 2021-01-04 19:58

I\'m using code from the following URL in order to get sound data from the microphone with AudioRecord: http://www.dreamincode.net/forums/topic/303235-visualizing-sound-from

2条回答
  •  醉酒成梦
    2021-01-04 20:17

    Sadly, only one app at a time can access the microphone (just like the camera).

    Also, there is no standard way to inform another app that you want access to the microphone (so that they release the resources and let you access it). You could however send a broadcast to all other apps ("requesting the microphone"), but the other apps would have to implement this feature (and very few or zero developers will do this).

    I would recommend you to simply inform the user that the microphone is currently not available, because you can't do anything else.

提交回复
热议问题