We have an Android device on which we would like to use the microphone
in 2 app simultaneously.
In fact, we have a vocal command service that is running in the background (we are using the CMU Sphinx
library). The problem is when we start a video recorder (camera application), we can't start the recording as 2 applications can't access to the microphone at the same time.
Error
08-20 12:20:14.601: I/MediaRecorderJNI(7261): prepare: surface=0x59590668
08-20 12:20:15.916: E/MediaRecorder(7261): start failed: -38
08-20 12:20:15.916: E/com.example.CamcorderView(7261): Failed to start recorder.
08-20 12:20:15.916: E/com.example.CamcorderView(7261): java.lang.IllegalStateException
08-20 12:20:15.916: E/com.example.CamcorderView(7261): at android.media.MediaRecorder.start(Native Method)
Note that the camera works well when the vocal service is off.
Moreover, I precise that I've already read this thread :
Android: Accessing the microphone simultaniously (RecognizerIntent + own app)
but the difference here is that we have a hand on the O/S and the kernel. So we can apply patch if needed.
Is it an SDK/OS/Kernel
limitation? Is there any workaround ?