pocketsphinx.js icon indicating copy to clipboard operation
pocketsphinx.js copied to clipboard

Buffer in recognizer uses obsolete data on multiple "process"-requests

Open laudenberg opened this issue 4 years ago • 0 comments

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

laudenberg avatar Jun 25 '20 12:06 laudenberg