Menu

PocketSphinx with bluetooth microphone

Help
2016-06-20
2016-08-15
  • Shrikant Bondre

    Shrikant Bondre - 2016-06-20

    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!!!

     
    • Nickolay V. Shmyrev

      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.

       
  • Shrikant Bondre

    Shrikant Bondre - 2016-06-21

    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.

    Here I am attaching the Logcat Log for bluetooth connected use case.
    
    More details,
    Pocketsphinx lib :- pocketsphinx-android-5prealpha-nolib.jar
    Machine :- CentOS Linux 7 - 64 bit
    Studio :-  Android studio 1.1.0
    Device :- Moto G 4 plus
    
     
    • Nickolay V. Shmyrev

      Provide a complete logcat together with the raw audio files stored on the device as mentioned in that logcat.

       
      • Nickolay V. Shmyrev

        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

         
  • Shrikant Bondre

    Shrikant Bondre - 2016-06-21

    Okay Nickolay

     
  • Shrikant Bondre

    Shrikant Bondre - 2016-06-21

    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.

     
  • Shrikant Bondre

    Shrikant Bondre - 2016-06-21

    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.

     
    • Nickolay V. Shmyrev

      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.

       
  • G10DRAS

    G10DRAS - 2016-06-22

    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.

     
  • Shrikant Bondre

    Shrikant Bondre - 2016-06-22

    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.

     
  • Shrikant Bondre

    Shrikant Bondre - 2016-06-22

    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?

     
  • Shrikant Bondre

    Shrikant Bondre - 2016-06-22

    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.

     
  • Shrikant Bondre

    Shrikant Bondre - 2016-06-23

    Any Help?
    Please.

     
    • Nickolay V. Shmyrev

      Provide an updated logcat and raw files.

       
  • Shrikant Bondre

    Shrikant Bondre - 2016-06-24

    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.

    • Shrikant
     
    • Nickolay V. Shmyrev

      Your keyword threshold 1e-15 is too small, you need a value like 1e-30.

       
  • Shrikant Bondre

    Shrikant Bondre - 2016-06-27

    Doesn't this will cause false recognition?

     
  • Shrikant Bondre

    Shrikant Bondre - 2016-08-05

    @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?

     
    • Nickolay V. Shmyrev

      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.

       
  • Shrikant Bondre

    Shrikant Bondre - 2016-08-08

    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.

     
    • Nickolay V. Shmyrev

      Without code it is hard to help you, for now your description is too vague.

       
  • Shrikant Bondre

    Shrikant Bondre - 2016-08-12

    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.

     
    • Nickolay V. Shmyrev

      You can provide raw dump files to get help on this issue.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.