Week 9: Debugging Emscripten compiled pocketsphinx.js with new alignment features

This week was mostly spent debugging the new state alignment feature implemented in pocketsphinx.js. The fork can be found here.

Changes can be noticed as the addition of two new functions:

  1. wordAlign(const std::vector<int16_t>& buffer, const std::string& word)
    • This function initializes an instance of acoustic model object and alignment search object. The buffer is read as 2048 integer values at a time and phoneme alignment is searched.
  2. getWordAlignSeg(Segmentation& seg)
    • This function returns the segmentation as phoneme ID, start timestamp, duration and acoustic model score.
I have been facing a few bugs in this code when I pass a Javascript object to this function, array to decode and the word as string, it gives me unreasonably high amount of segments as opposed to standalone code. I am trying to print a few debug messages to corner the problem but it doesn't seem to work. Emscripten strips off the debug messages on compilation and it doesn't get printed on Javascript console. Hope I can figure this out. 

P.S: Any experts on Emscripten can suggest the fix!

See you guys.

Comments

Popular Posts