Hi,
I'm currently working on a sphinx2 voice to keyboard driver. So far recognition is fine and quick (under 2 seconds) but once in a while the search may take up to a minute.
This is not workable so I want to interrupt uttproc_result. I do this with alarm and longjmp, setjmp functions. This should work in theory but unfortunately it is not possible to abort an utterance after calling uttproc_end_utt (you have to call this before you call uttproc_result so this is a catch 22 situation).This is because uttproc_abort checks if uttproc_end_utt has already been called. It is also impossible to start a new utterance because the internal uttstate is not UTTSTATE_IDLE.
This seems like a bug to me.
It should be possible to abort an utterance at all time, no matter what the current internal state is, and start a new utterance with uttproc_begin_utt afterwards. The abort function should be clever enough to clean up and switch to IDLE mode afterwards.
Ofcourse I can end and re-init all but this takes too long.
Is this the wrong approach? How can I control the maximum search time (no found result is fine).
Kind regards
Peter van Paassen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm currently working on a sphinx2 voice to keyboard driver. So far recognition is fine and quick (under 2 seconds) but once in a while the search may take up to a minute.
This is not workable so I want to interrupt uttproc_result. I do this with alarm and longjmp, setjmp functions. This should work in theory but unfortunately it is not possible to abort an utterance after calling uttproc_end_utt (you have to call this before you call uttproc_result so this is a catch 22 situation).This is because uttproc_abort checks if uttproc_end_utt has already been called. It is also impossible to start a new utterance because the internal uttstate is not UTTSTATE_IDLE.
This seems like a bug to me.
It should be possible to abort an utterance at all time, no matter what the current internal state is, and start a new utterance with uttproc_begin_utt afterwards. The abort function should be clever enough to clean up and switch to IDLE mode afterwards.
Ofcourse I can end and re-init all but this takes too long.
Is this the wrong approach? How can I control the maximum search time (no found result is fine).
Kind regards
Peter van Paassen