I have been tinkering around with the CMUSphinx/Pocketsphinx and Node.js. What I'd like to do is spawn pocketsphinx_continuous in the background and then use node as a traffic control layer on top.
However, pocketsphinx seems to ignore stdout completely. Does anyone know if that is by design? If I run it via CLI I will see out put like:
READY....
Listening...
INFO: ngram_search.c(467): Resized score stack to 200000 entries INFO: ngram_search.c(459): Resized backpointer table to 10000 entries
The INFO and error outputs can be seen from stderror. AFAICT the READY, Listening and any successful word recognition cannot be seen and are not being sent to stdout.
My node is really simple and works fine on a test bash script doing a Hello World like echo:
if(ps == null) {
//'-logfn','/dev/null',
//sudo pocketsphinx_continuous -dict lm/8531.dic -lm lm/8531.lm -kws words.kws -kws_threshold 1e-40 -logfn /dev/null -inmic yes
//console.log(process.stdout.write(''));
ps = spawn('pocketsphinx_continuous', ['-nfft','2048', '-hmm','/usr/local/share/pocketsphinx/model/en-us/en-us', '-dict','lm/8531.dic', '-lm','lm/8531.lm', '-kws','words.kws', '-kws_threshold','1e-40', '-inmic', 'yes']);
//ps = spawn('bash',['test.sh']);
//ps.stderr.pipe(process.stdout);
//console.log(ps.stdout.write(''));
ps.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
ps.stderr.on('data', function (data) {
console.log('stderr: ' + data);
});
}
Is this info only available via GStreamer or the like? Thanks in advance.