Menu

Clearing the decoder buffer in sphinx_decoder

Help
ashuser
2012-04-30
2016-10-29
  • ashuser

    ashuser - 2012-04-30

    I'm using s3_decode_hypothesis function to get the partial hypothesis result.
    Once the result is obtained I want to clear the decoder buffer. For ex: I'm
    reading from an audio file at 10k bytes at a time. The buffer is given as in
    input to fe_process_utt and then s3_decode_hypothesis function is called. The
    decoder gives the partial recognition result. But the next time I read 10k
    bytes again if there is a recognition, the partial recognition contains the
    concatenated result of the current and previous iteration results. I want only
    the current iteration results. How do I achieve this?

    For ex: the first iteration the recognition is "ONE" , second iteration is
    "TWO" then the decode_hypothesis returns "ONE TWO" as hypothesis string. I
    want only "TWO" as the recognized string.

     
  • Nickolay V. Shmyrev

    It is not possible without source code modification. It's also not very easy
    given the overall speech recognition algorithm.

     
  • ashuser

    ashuser - 2012-04-30

    then I guess the only way is to modify the source code and keep a pointer to
    the data that is sent in each iteration :)

     
  • Nickolay V. Shmyrev

    then I guess the only way is to modify the source code and keep a pointer to
    the data that is sent in each iteration :)

    It is not the answer. Partial result may change altogether during the search.

     
  • Kristoffer

    Kristoffer - 2016-10-12

    Is this problem also present after a call to ps_set_search? I.e. Does switching between two grammars imply two buffers?

     
    • Nickolay V. Shmyrev

      Yes, definitely.

       
  • Kristoffer

    Kristoffer - 2016-10-12

    Yes as in "Yes, ps_set_search will definitely be affected."?

    Anyway, can you please give some hints on how to modify the source to be able to clear the buffer? I really need a way of telling the decoder that any sound from timestamp A to B should be ignored. Tearing down and re-initializing the entire recognizer is too slow.

     
    • Nickolay V. Shmyrev

      If you don't want to process some samples, just don't send them to the decoder. To start new search use ps_start_utt, it will reset recognizer state. You do not need to reinit recognizer for that.

       
  • Kristoffer

    Kristoffer - 2016-10-29

    Thanks. So no need to call ps_end_utt first?

     
    • Nickolay V. Shmyrev

      You need to end the previous utterance.

       

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.