I am trying to develop one simple application for recognizing the voice using pocketsphinx. It's working fine with phone mic, but when it comes to paired bluetooth mic, it is not recognizing voice at all.
Can anyone suggest what parameters I need to set in order to make it work fine with bluetooth mic.
You need to explain more what do you mean by "not recognizing voice at all". You need to be technical and precise - provide an exact description of steps, provide the expected results, provide the actual results, provide the code changes you made, provide logcat output.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now after installing this sample app on device following are the use cases,
1) Bluetooth Not Connected to device :-
In this case when I am commanding the keyphrase "oh mighty computer". Now as Phone's microphone is in action, its recognizing it properly and I can proceed with further commands as given in demo.
2) Bluetooth connected to device :-
In this case, I am getting the event of bluetooth connectivity. And on that event I am performing the changes to AudioManager as suggested in the link https://sourceforge.net/p/cmusphinx/discussion/help/thread/5be47108/
That is technically I am supposed to be ready to use bluetooth microphone for commands. Now when I am commanding the keyphrase "oh mighty computer" Nothing is happening in app, the application is not reacting and It's still waiting/listening for the keyphrase "oh mighty computer" command.
Hi Niclolay,
While testing I observed that when connected with bluetooth and near to phone, in this case app is working properly. This might be due to phones microphone is taking direct voice inputs and not bluetooths microphone. and when I am moving say 5 meters away from phone with bluetooth and commanding near bluetooths mic, app is not acting.
Here is the logcat and raw files attached. Log contains log for both cases I mentioned above.
In addition I am using
"JBL GO Blue Portable Mobile/Tablet Speaker" and "SSK bluetooth G16 with NFC" bluetooth devices for my testing.
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Microphone should be on mute. Are you sure handler for bluetooth is exectuted? You can add additional debug statement there and see if switch actually happens. For now I don't see anything in logcat about that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could you check if both of your BT devices are supporting HSP (Headset Profile)?
If you have any BT headset like NOKIA BH-503, which supports both HSP and HFP profiles, test with that and see if it works.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I was missing with the permission to mute the microphone (android.permission.MODIFY_AUDIO_SETTINGS). Now I can mute the microphone But still app is not responding to commands via paired bluetooth device.
Am I missing anything other than this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry to bother but is there any update on this ? I am in a vry critical stage of my project and need to have solution for this issue like anything. Any further help would help. Thanks for all your help / inputs so far.
Shrikant
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@Nickolay, I am still stuck with this issue, is there any other mechanism with which I can implement pocketsphinx in my andorid application, which will work reliably?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is hard to help you since you didn't provide enough information about your current status, I already gave you recommendations which you are expected to follow. I am not sure what is the problem now.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Nickolay,
Sorry for confusion.
I tried your suggestion to change keyword threshold value from 1e-15 to 1e-30. But this change is causing false alarms.
Say for example pocketsphinx is initialize to search from grammer words "yes", "No", now if i am keeping silent even though app is taking random result value from yes or no and moving ahead. This is my main problem. I want recognizer to follow the proper commands only and not to take any random selection. How can I improve the accuracy of pocketsphinx so that it can work reliably.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am working on the sample project provided by pocketsphinx, Here attached is the main class of application (MainActivity.java).
When I am commanding key phrase "Oh mighty computer", then it is looking for one of menu "digits | forecast", now if I am keeping silence then recognizer is automatically taking one of the menu and starts working ahead. like taking digits and looking for digits. Why it is recognizing random value even after I am keeping silence?
HI Everyone,
I am trying to develop one simple application for recognizing the voice using pocketsphinx. It's working fine with phone mic, but when it comes to paired bluetooth mic, it is not recognizing voice at all.
Can anyone suggest what parameters I need to set in order to make it work fine with bluetooth mic.
Here is the link of sample application I am referring,
https://github.com/cmusphinx/pocketsphinx-android-demo
Need Help!!!
You need to explain more what do you mean by "not recognizing voice at all". You need to be technical and precise - provide an exact description of steps, provide the expected results, provide the actual results, provide the code changes you made, provide logcat output.
Hi Nickolay,
Sorry for insufficient inputs, here are the details for the problem.
I just downloaded the project from the github link https://github.com/cmusphinx/pocketsphinx-android-demo, configured the project in android studio (On Linux machine) .
And additionally just added one receiver to detect bluetooth connectivity referring following link ,
https://sourceforge.net/p/cmusphinx/discussion/help/thread/5be47108/
Now after installing this sample app on device following are the use cases,
1) Bluetooth Not Connected to device :-
In this case when I am commanding the keyphrase "oh mighty computer". Now as Phone's microphone is in action, its recognizing it properly and I can proceed with further commands as given in demo.
2) Bluetooth connected to device :-
In this case, I am getting the event of bluetooth connectivity. And on that event I am performing the changes to AudioManager as suggested in the link https://sourceforge.net/p/cmusphinx/discussion/help/thread/5be47108/
That is technically I am supposed to be ready to use bluetooth microphone for commands. Now when I am commanding the keyphrase "oh mighty computer" Nothing is happening in app, the application is not reacting and It's still waiting/listening for the keyphrase "oh mighty computer" command.
Provide a complete logcat together with the raw audio files stored on the device as mentioned in that logcat.
Also I believe Moto G is known to be not very good at audio manager, they screwed things there.
Try the same code on Samsung, for example Galaxy III
Okay Nickolay
Hi Niclolay,
While testing I observed that when connected with bluetooth and near to phone, in this case app is working properly. This might be due to phones microphone is taking direct voice inputs and not bluetooths microphone. and when I am moving say 5 meters away from phone with bluetooth and commanding near bluetooths mic, app is not acting.
Here is the logcat and raw files attached. Log contains log for both cases I mentioned above.
In addition I am using
"JBL GO Blue Portable Mobile/Tablet Speaker" and "SSK bluetooth G16 with NFC" bluetooth devices for my testing.
Thanks in advance.
Microphone should be on mute. Are you sure handler for bluetooth is exectuted? You can add additional debug statement there and see if switch actually happens. For now I don't see anything in logcat about that.
Could you check if both of your BT devices are supporting HSP (Headset Profile)?
If you have any BT headset like NOKIA BH-503, which supports both HSP and HFP profiles, test with that and see if it works.
Hi,
I checked for HSP and HFP support, Both bluetooth devices are having support to HSP and HFP.
@Nickolay - Yes, Bluetooth handler is executing, I cross verified it.
The code to mute the microphone is getting executed,
AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
am.startBluetoothSco();
am.setMicrophoneMute(true);
but its not muting the microphone.
I also tried with
am.setMode(AudioManager.MODE_IN_COMMUNICATION);
But of no use.
Can you suggest any other way to make microphone mute.
Thanks in advance.
Hi Nickolay,
Sorry, I was missing with the permission to mute the microphone (android.permission.MODIFY_AUDIO_SETTINGS). Now I can mute the microphone But still app is not responding to commands via paired bluetooth device.
Am I missing anything other than this?
Hi Niickolay,
Here I am sharing my source and manifest files, can u please check and let me know if I am missing anything.
Thanks.
Any Help?
Please.
Provide an updated logcat and raw files.
Thanks Nickolay,
Here is the source file along with log and raw files.
HI Nickolay,
Sorry to bother but is there any update on this ? I am in a vry critical stage of my project and need to have solution for this issue like anything. Any further help would help. Thanks for all your help / inputs so far.
Your keyword threshold 1e-15 is too small, you need a value like 1e-30.
Doesn't this will cause false recognition?
@Nickolay, I am still stuck with this issue, is there any other mechanism with which I can implement pocketsphinx in my andorid application, which will work reliably?
It is hard to help you since you didn't provide enough information about your current status, I already gave you recommendations which you are expected to follow. I am not sure what is the problem now.
Hi Nickolay,
Sorry for confusion.
I tried your suggestion to change keyword threshold value from 1e-15 to 1e-30. But this change is causing false alarms.
Say for example pocketsphinx is initialize to search from grammer words "yes", "No", now if i am keeping silent even though app is taking random result value from yes or no and moving ahead. This is my main problem. I want recognizer to follow the proper commands only and not to take any random selection. How can I improve the accuracy of pocketsphinx so that it can work reliably.
Without code it is hard to help you, for now your description is too vague.
HI Nickolay,
I am working on the sample project provided by pocketsphinx, Here attached is the main class of application (MainActivity.java).
When I am commanding key phrase "Oh mighty computer", then it is looking for one of menu "digits | forecast", now if I am keeping silence then recognizer is automatically taking one of the menu and starts working ahead. like taking digits and looking for digits. Why it is recognizing random value even after I am keeping silence?
How can I avoid this?
Please help...
Thanks,
Shrikant.
You can provide raw dump files to get help on this issue.