cmusphinx/pocketsphinx-android

Releasing the microphone while not listening?

tiloc opened this issue · 1 comments

tiloc commented

Hello,
what is the recommended practice to release the device's microphone while not listening? For instance, if my Activity goes into the background because a phone call is coming in? I would like to keep the expensively setup recognizer instance, but release the microphone for use by other apps.
From looking at the code it seems to me that I have to tear down the recognizer to release the microphone, but wanted to ask prior to creating my own build of pocketsphinx-android.
Thanks!

Recognizer.cancel stops the recorder and releases the microphone. Recognizer.startListening restarts the recording afterwards. Recognizer stays initialized.