pocketsphinx.js
pocketsphinx.js copied to clipboard
Buffer in recognizer uses obsolete data on multiple "process"-requests
Sending multiple "process"-requests to the recognizer, where the latter data length is shorter than the former, leads recognizer.js to only override the front portion of the data, leaving older data in the end of the buffer:
while (buffer.size() < array.length)
buffer.push_back(0);
for (var i = 0 ; i < array.length ; i++)
buffer.set(i, array[i]);
https://github.com/syl22-00/pocketsphinx.js/blob/master/webapp/js/recognizer.js#L284-L287