Menu

pocketsphinx returning random characters in KWS mode

Help
2016-09-23
2016-09-27
  • James Dessart

    James Dessart - 2016-09-23

    I've been working on an iOS app using pocketsphinx-5realpha, using the standard en-us acoustic model, the CMU dictionary, and a small number of keywords for keyword spotting (see below). I know the words are not ideal, and recognition is understandably lousy. That's not the problem, however.

    Keywords:
    GO BACK /1e-8/
    GO FORWARD /1e-7/
    CONTINUE /1e-10/
    PAUSE /1e-15/
    CLOSE /1e-13/
    CONTINUE /1e-10/
    PLAY /1e-10/
    REPEAT /1e-10/
    STOP /1e-17/

    Previously, ps_get_hyp would sometimes give an empty string, or a proper hypothesis, but occasionally a string with random characters. After an upgrade to Xcode 8 and iOS 10, it now only ever outputs these random strings. Here's an example:

    \255\276\345\351ݺ\260@r

    Clearly, this isn't in my keyword list.

    More details: ps_start_utt, ps_process_raw, ps_get_in_speech, ps_end_utt, and ps_get_hyp are all called from an audio thread. ps_init is called from the main thread.

    Is there a possible threading issue here? I rebuilt the libraries to be sure everything is using the same toolchain, just to be sure, but it didn't help.

    Is there something else that could be going on?

    Thanks!

     
    • Nickolay V. Shmyrev

      It feels like some sort of memory corruption, but it is probably originated from your code, not from pocketsphinx. I don't think it's a threading issue.

      You can try to debug this by exploring values os keyphrases list in kws_search object on various stages of execution.

       
      • James Dessart

        James Dessart - 2016-09-26

        Is there a flag I can enable somewhere for that? I don't really have the luxury of time at the moment. I'd love to dig around in the internals, but if there's a quick debug flag that causes the information to get printed out that'd be best.

        Thanks!

         
        • Nickolay V. Shmyrev

          No, there are no magic flags.

           
  • James Dessart

    James Dessart - 2016-09-27

    The hypothesis string was getting stomped on somewhere within ps_start_utt, so I'm no longer relying on it being valid after any call to a sphinx function.

     
    • Nickolay V. Shmyrev

      Yes, this is correct, you need to copy it to reuse later.

       

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.