Is it possible to share audio input (Microphone) stream in Android?

若如初见. 提交于 2019-11-30 21:18:17

Simple Answer would be "NO" , This is just because Audio Recording Method is synchronized. So Two or more resources can not attempt it simantenously. Doing so might sometime force close the applicatio.

I know this is old, but you may be able to kill/reactivate the microphone connection every few minutes to simulate a shared microphone resource. This is an untested hack...

Essentially:

  1. Set a timer to disconnect from the mic every few minutes
      Hopefully, if another app is trying to collect mic data, it can
      while blocking other apps from collecting at the same time
  2. Attempt to reconnect and test for data
      if the other app has the mic and is blocking data then you can
      try to reconnect at some time in the future.

I haven't tested this but I need a solution too so I'll post code if it works.

Recording audio/video, while other applications are running , is possible. I've done it in Sony Xperia Z1, continuously recorded videos and calls with a downloaded screen recorder. However, I do believe that this was a glitch of some sort, as it stopped being able to record after some time (about 2 months)and started showing an error which says that the microphone is being used by another application...

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