Menu

Continous live phoneme output from pocketsphinx

Help
Ben
2019-04-14
2019-10-18
  • Ben

    Ben - 2019-04-14

    I am trying to get live phoneme output as they are spoken - not listening for a sentence or keywords, just output the moment anything is recognized. I was able to download and compile sphinxbase and pocketsphinx, and if I run pocketsphinx_continuous via the shell with -allphone_ci yes and -allphone en-us-phone.lm.bin it seems to work pretty well. The issue is, it doesn't update the output live, instead it appears to wait for a small period of silence and then displays all of what was said before the silence. I was essetnially a "stream of consciousness" of the recognized phonemes, constantly outputting anything it recognizes or constantly outputting SIL if it recognizes nothing. Is there any way to configure it to do this?

     
    • Nickolay V. Shmyrev

      Modify pocketsphinx_continuous to call ps_hyp and print result every time the chunk of audio is processed. You can modify python example script too.

       
      • Ben

        Ben - 2019-04-14

        I couldn't find any methods called ps_hyp, but I assumed you meant ps_get_hyp? I added some test lines to continuous.c and it is now giving me live output, although it is additive as I speak (not just current phoneme, it prints every phoneme during that speaking session with the latest one appended at the end, but it is live). I could split the string and just grab the last one if needed, so I think this will work. Thank you for pointing me in that direction! Here is an example.

         

        Last edit: Ben 2019-04-14
  • Ben

    Ben - 2019-04-14

    Thanks for the quick response, I will give that a shot. I'm not a C++ or Python guy, though, but if I made it this far I might be able to figure it out :P

     
  • Mickael Fontaine

    Hello,

    You can try to add the -vad_postspeech parameter with a value of 5 or 10, it will wait for 5 or 10sec for a silence after a speech instead of 50 by default.

     

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.