Menu

forcing recognizer() to return

Help
Troy Smith
2007-12-07
2012-09-22
  • Troy Smith

    Troy Smith - 2007-12-07

    Hello,

    I'm fighting with the issuer of getting recognizer() to return after a certain amount of time. I've read the others posts regarding this but haven't been able to figure things out. I'm using the beta release of sphinx4, slightly modified as shown below, and have tried the following:

    1. Creating my own decoder

    I created my own decoder class which extended the sphinx Decoder and overrode the decode method. I had to change the original Decode class provide access to the SearchManager variable and the fireResultListeners() method. Here is what my decode loop looks like:
    ...
    searchManager.startRecognition();
    while( !done ){
    result = searchManager.recognize(1);

    if( max time has expired logic ){
      done = true;
    }
    ...
    

    }

    The problem I'm having with this code is that the frontend processors seem to not return after a single frame. If my memory serves me right, SpeechClassifer, SpeechMarker were waiting for more data before returning. So my max time has expired logic is not running after every single frame.

    I should mention that I'm using the epFrontEnd as is that came with the helloworld demo.

    1. Next I tried creating a ataProcessor that would insert a DataEndSignal to stop recognition. In the epFrontEnd config I put my DataProcess between the microphone and speechClassifier. Here is what my getData() method looks like:

    public Data getData() throws DataProcessingException{
    if( time has expired logic ){
    return( new DataEndSignal(timeCollecting) );
    }
    else{
    return( getPredecessor().getData());
    }
    }

    I verified that the DataEndSignal was being returned by that did not end the recognition as again it seems as if SpeechClassifer or SpeechMarker is waiting for something else before returning.

    3.
    I also tried the latest sv version but had major recognition issues -- in testing the demos, recognizer would recognize lots of words that were never spoken. I assume that the setup needs to be tweaked but didn't spend much time on this.

    Is there something I am doing wrong or another way to approach this problem?

    Thanks in advance,
    Troy

     

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.