Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to initialize recorder. Microphone might be already in use... #6

Closed
gessha opened this issue Oct 9, 2015 · 7 comments
Closed

Comments

@gessha
Copy link

gessha commented Oct 9, 2015

I downloaded the demo, opened it with Android Studuo but when I tried to run it, I got the following error:

Error creating AudioRecord instance: initialization check failed.
Error code -20 when initializing native AudioRecord object.

and the phone says:
Failed to init recognizer java.io.IOException: Failed to initialize recorder. Microphone might be already in use.

On a hTC One S( Android 4.1.1 )

@ShockleyJE
Copy link

Sounds about right. Implementation of pocket sphinx on my application requires sole access to the microphone. Unfortunate but workable

@aribornstein
Copy link

I have killed all other apps and am also having this issue. What do I need to change change to get the demo to work?

@mbait
Copy link
Contributor

mbait commented Mar 24, 2016

It might be Google Now who acquired the mic.
On Mar 24, 2016 1:41 PM, "PythicCoder" notifications@github.com wrote:

I have killed all other apps and am also having this issue. What do I need
to change change to get the demo to work?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#6 (comment)

@aribornstein
Copy link

How do i find out? I currently have no apps running in the foreground or background. Is there a way to give pocket sphinx priority?

@nshmyrev
Copy link
Contributor

Turn off google now functions in settings and try again. Recording should work, you can try with any recording application if it can record or not. If recording work but pocketsphinx does not, this is an issue to investigate, otherwise you need to find the service that blocks your microphone.

@barrievince
Copy link

barrievince commented Aug 21, 2017

I was receiving the exception and found I had to go into the application manager and turn on the "Microphone" permission manually. This corrected the problem. This probably has to do with the change to permission handling in Android 6 (API 23).

Before initializing PocketSphinx you should verify the app has the permission turned on. If not, don't start.

@nshmyrev
Copy link
Contributor

The demo has the code to request permissions if they are missing, you might just try the recent version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants