cmusphinx / pocketsphinx

A small speech recognizer
Other
3.9k stars 714 forks source link

Live.c Example not working #313

Closed roccopersico99 closed 1 year ago

roccopersico99 commented 1 year ago

I am unable to get the live.c example working, and I believe it boils down to an issue with sox. From my understanding, live.c uses sox to take audio input from the default audio device, converts it to a raw format, and sends it to stdout, which is then piped into the FILE* sox ptr and used to fill the frame buffer, which is then given to the endpointer for processing and finally a hypothesis phrase can be obtained. From my research, it appears that output piping in sox is broken for 14.0.x versions but works fine in 13.0.x versions (https://stackoverflow.com/questions/30166384/sox-piping-output-in-windows). However, sox 13.0.x versions do not appear to support using audio devices as input (no -d option) so live.c is not possible with either version of sox. Please let me know if I'm misunderstanding or just missing something entirely here, thanks!

dhdaines commented 1 year ago

Hm, it works for me with v14.4.2 on Ubuntu 22.04.

If you modify the code to simply read from stdin, and pipe a raw audio file to it, does it still fail to work?

dhdaines commented 1 year ago

Also, it's entirely likely that it just doesn't work on Windows, because lots of things don't...