Thanks Robbie for your suggestion. I've tried it but it doesn't seem to work for my problem because I am changing grammars and during the change I need the recognizer not to be in the recognize state.
Holger, I used your class DataInserter and changed the configuration file to include these two lines:
1) Make sure that you're using the correct frontend. Many of the demonstration configurations contain several frontends (@s4devs: why?).
2) try to debug your application. Does the used acoustic scorer really receives the inserted DataEndSignal?
Are you using beta1-release code or a recent svn-revision?
By the way, the idea of Robbie is a really nice one (much better than all this DataInserter stuff). If you're using the Microphone only you should consider to use it. It should work. If not it's a bug.
-Holger
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I agree with Holger--if calling stopRecording does not work, this means there is a bug somewhere (possibly in your code since this has worked fine for me).
Are you planning on input from other sources, or just the microphone? For input streams, you could probably extend the StreamDataSource to have a stop function that inserts a DataEndSignal (which is probably similar to what Holger has suggested). You can create streams out of almost anything, so that could be quite useful.
Paul's (it was Paul, right?) idea to edit/add a new decoder seems very reasonable, too.
Robbie
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think it's up to the s4-api to provide such a start/stop-functionality. I would propose to use a generic DataSource interface which could be implemented by all given DataSources. This interface should provide all necessary methods to start, stop, pause and continue data acquisition.
Just as a draft I've added such an interface to the svn (edu.cmu.sphinx.util). The implementatio for the microphone is just straight forward. For the offline-datasources (AudioFileDataSource & friends) it would require some DataInserter-like procedure. Does this make sense?
-Holger
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sounds reasonable, although the question arises as to whose responsibility it is to start/stop. Is it the data source, or the decoder? I can imagine arguments either way...
robbie
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just skimmed the other post mentioned by holgerbrandl, so I'm not sure if this was included there or not...but...
Assuming your input is from the microphone, just invoke stopRecording() on the microphone object (you can obtain a reference to it through the configuration manager).
I wrote a Swing-based facade to Sphinx-4 that used this approach and it worked great.
Regards,
Robbie
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
How can I pause or stop the recognizer after I call myRecognizer.recognize()?
Thanks
Hi,
Thanks Robbie for your suggestion. I've tried it but it doesn't seem to work for my problem because I am changing grammars and during the change I need the recognizer not to be in the recognize state.
Holger, I used your class DataInserter and changed the configuration file to include these two lines:
<component name="epFrontEnd" type="edu.cmu.sphinx.frontend.FrontEnd">
<propertylist name="pipeline">
<item>microphone </item>
!!!This one <item>dataInserter</item>
<item>speechClassifier </item>
<item>speechMarker </item>
<item>nonSpeechDataFilter </item>
<item>premphasizer </item>
<item>windower </item>
.....
and
<component name="dataInserter" type="Uvic.WebSpeech.DataInserter" />
which I think should be enough to make the code work. In my code, I retrieve an instance of the inserter using:
myInserter = (DataInserter) cm.lookup("dataInserter");
and then use this to send an end signal:
myInserter.insertData(new DataEndSignal(10));
But still my recognizer is in the recognizing state after that.
What would you think is the problem?
Best Regards,
Foad
Hi Foad,
1) Make sure that you're using the correct frontend. Many of the demonstration configurations contain several frontends (@s4devs: why?).
2) try to debug your application. Does the used acoustic scorer really receives the inserted DataEndSignal?
Are you using beta1-release code or a recent svn-revision?
By the way, the idea of Robbie is a really nice one (much better than all this DataInserter stuff). If you're using the Microphone only you should consider to use it. It should work. If not it's a bug.
-Holger
I agree with Holger--if calling stopRecording does not work, this means there is a bug somewhere (possibly in your code since this has worked fine for me).
Are you planning on input from other sources, or just the microphone? For input streams, you could probably extend the StreamDataSource to have a stop function that inserts a DataEndSignal (which is probably similar to what Holger has suggested). You can create streams out of almost anything, so that could be quite useful.
Paul's (it was Paul, right?) idea to edit/add a new decoder seems very reasonable, too.
Robbie
Hi Robbie, hi Paul?, hi Foad?,
I think it's up to the s4-api to provide such a start/stop-functionality. I would propose to use a generic DataSource interface which could be implemented by all given DataSources. This interface should provide all necessary methods to start, stop, pause and continue data acquisition.
Just as a draft I've added such an interface to the svn (edu.cmu.sphinx.util). The implementatio for the microphone is just straight forward. For the offline-datasources (AudioFileDataSource & friends) it would require some DataInserter-like procedure. Does this make sense?
-Holger
Sounds reasonable, although the question arises as to whose responsibility it is to start/stop. Is it the data source, or the decoder? I can imagine arguments either way...
robbie
hi,
this (quite recent) thread discusses several solutions to your problem:
http://sourceforge.net/forum/message.php?msg_id=4259051
Best regards,
Holger
I just skimmed the other post mentioned by holgerbrandl, so I'm not sure if this was included there or not...but...
Assuming your input is from the microphone, just invoke stopRecording() on the microphone object (you can obtain a reference to it through the configuration manager).
I wrote a Swing-based facade to Sphinx-4 that used this approach and it worked great.
Regards,
Robbie
Hi,
Thanks. I will try the method suggested there.
Best Regards,
Foad