can we programmatically call get audio phonemes instead of using command

217 Views Asked by At

I have used pocketsphinx command to extract phonemes and it is working fine

pocketsphinx_continuous -infile test/data/goforward.raw -hmm model/en-us/en-us \
                        -allphone model/en-us/en-us-phone.lm.bin -backtrace yes \
                        -beam 1e-20 -pbeam 1e-20 -lw 2.0

but now i want to do it programmatically. For using the above command we need to go to "pocketsphinx\bin\Release\Win32" and then run the command. Is it possible to do this programmatically without moving to "pocketsphinx\bin\Release\Win32" folder?

Also, is this functionality available in "pocketsphinx.js"?

1

There are 1 best solutions below

2
Nikolay Shmyrev On

Yes, you can do it in pocketsphinx.js too:

var config = new Module.Config();
config.push_back(["-allphone", "en-us-phone.lm.bin"]);
config.push_back(["-beam", "1e-20"]);
config.push_back(["-pbeam", "1e-20"]);
config.push_back(["-lw", "2.0"]);
var recognizer = new Module.recognizer(config);
config.delete();
/* ... */
recognizer.delete();

You need to package en-us-phone.lm.bin beforehand or use lazyLoad.