2

i want to use pocketsphinx in my app while recording audio in the background (unrelated to the speech recognition - as part of a video recording).
while trying to do so i constantly get the exception:

ErrorFailed to start recording. Microphone might be already in use.

I understand that in android two different activities cannot share the mic (Pocketsphinx Android demo error: "Failed to init recognizer java.io.IOException: Failed to initialize recorder. Microphone might already be in use.") , but since i'm using a different audio source i was hoping there is a way to overcome this problem.
From what i saw pocketsphinx is using an AudioRecorder with a AudioSource=VoiceRecognition. Since i'm using a different audio source for the audio recording, i hope there is a way to avoid this exception. Any other solutions/workarounds would also be helpful. Thanks!

Community
  • 1
  • 1
user2928842
  • 93
  • 1
  • 1
  • 9

1 Answers1

0

You have a main thread. Recording audio while pocketsphinx recognizes, I don't think it is possible since the auidorecoder object is already created and is being used. I think you have 2 options: 1st. Stop pocketsphinx and record audio. 2nd. Recover the audio recordings made by pocketsphinx.

It should be possible to dump the raw utterances into a folder if you set the -rawlogdir property for pocketsphinx_continuous. This works for me.

However, I'm using pocketsphinx with the GStreamer Interface (using python), and it gives me the following error: TypeError: object of type GstPocketSphinx' does not have propertyrawlogdir'

Nickolay: Do you know how to get around this or if it is not supported by GStreamer, then what do you do to save the utterance in this case?

But you may get the above error.