syl22-00 / pocketsphinx.js

Speech recognition in JavaScript and WebAssembly
1.49k stars 261 forks source link

Can this work on Cordova with real time keyword spotting? #38

Open mike-nelson opened 9 years ago

mike-nelson commented 9 years ago

Do you know if it's possible using Cordova plugins to capture the audio and pass it into the recognizer? Has anyone done this successfully and do you have any pointers?

It seems this could be done by capturing to a file but would that be too slow for real time keyword spotting?

syl22-00 commented 9 years ago

Sure, you can record audio using native code (the Audio Toolbox framework) and send the samples to the recognizer. There's plenty or resources on Apple's wesite, including sample code: https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html

But if you do native code, I don't see the point of using pocketsphinx.js, just go with pocketsphinx compiled natively.

mike-nelson commented 9 years ago

Thanks for the pointers. I was hoping to be able to do this with an existing plugin, without having to write any objective C. But I think I need to look into writing one.

Good point about pulling the C code in - if I do make an objective C plugin I could probably include the C source in it. Would the C version be significantly more perfomant on a phone do you think?