I want to record the Android microphone input simultaneously in two AudioRecord objects. Is there a way to duplicate the Android AudioSource.MIC or make it accessible from two instances simultaneously? If yes, how could I do this?
You cannot do this in android. In fact you cannot duplicate any record instance when one instance is already running , this applies to camera as well as mic. In case of output , like audio playout (and video display) there are modules to handle multiple streams, mix , resample etc (composing, rendering for display).
If you have the full android source code for your device,you can try to write a buffering mechanism, but that is not generic, scalable and is not simple.
In general if the recording object instance is opened and held by another application, there is nothing much you can do other than to display an error message. (Quick experiment- Record audio in the background and open the speech converter in your keyboard, it throws up an error)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With