I'm trying to run pocketsphinx on my ubuntu 14.04 desktop machine and I'm running into an issue with specifying the audio device when using ad_open_dev. I have an external mic that I plugged in and am initializing the device as follows (this is c++ code, ad is an ad_rec_t):
ad = ad_open_dev("sysdefault", (int) samprate);
ad_start_rec(ad);
I am getting the error "Error opening audio device sysdefault for capture: No such entity" followed by a seg fault (which might be unrelated) when I run the compiled code. However, when I run pocketsphinx_continuous -inmic yes I have absolutely no issues recognizing speech through the mic. I have tried the name "default" as well but that also didn't work. Does anyone know what parameter I should be passing instead of "sysdefault"? I can post the surrounding code as well if needed but it seems like the error is coming from here. Any help would be greatly appreciated!
EDIT: I passed ad_open_dev NULL instead of "sysdefault" and it seems to have worked (I'm no longer getting the error about opening the audio device). I am still getting a seg fault and it is caused by
config = cmd_ln_init(NULL, ps_args(), TRUE,
"-hmm", "/usr/local/share/pocketsphinx/model/en-us/en-us",
"-lm", "../audio/1638.lm",
"-dict", "../audio/1638.dic",
"-logfn", "/dev/null",
NULL);
ps = ps_init(config);
// this line causes the issue
ps_start_utt(ps);
Last edit: Raghu Nimmagadda 2017-06-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to run pocketsphinx on my ubuntu 14.04 desktop machine and I'm running into an issue with specifying the audio device when using ad_open_dev. I have an external mic that I plugged in and am initializing the device as follows (this is c++ code, ad is an ad_rec_t):
ad = ad_open_dev("sysdefault", (int) samprate);
ad_start_rec(ad);
I am getting the error "Error opening audio device sysdefault for capture: No such entity" followed by a seg fault (which might be unrelated) when I run the compiled code. However, when I run pocketsphinx_continuous -inmic yes I have absolutely no issues recognizing speech through the mic. I have tried the name "default" as well but that also didn't work. Does anyone know what parameter I should be passing instead of "sysdefault"? I can post the surrounding code as well if needed but it seems like the error is coming from here. Any help would be greatly appreciated!
EDIT: I passed ad_open_dev NULL instead of "sysdefault" and it seems to have worked (I'm no longer getting the error about opening the audio device). I am still getting a seg fault and it is caused by
config = cmd_ln_init(NULL, ps_args(), TRUE,
"-hmm", "/usr/local/share/pocketsphinx/model/en-us/en-us",
"-lm", "../audio/1638.lm",
"-dict", "../audio/1638.dic",
"-logfn", "/dev/null",
NULL);
ps = ps_init(config);
// this line causes the issue
ps_start_utt(ps);
Last edit: Raghu Nimmagadda 2017-06-09
You already asked this question at
https://stackoverflow.com/questions/44463307/pocketsphinx-seg-fault-with-ps-start-utt