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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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@rClearly, 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!
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.
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!
No, there are no magic flags.
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.
Yes, this is correct, you need to copy it to reuse later.