webkitSpeechRecognition and webkitSpeechGrammarList: Grammar with more than 700 words crash

68 views Asked by At

I am currently experimenting with the webkitSpeechRecognition and webkitSpeechGrammarList in a React application, on Chrome web browser.

My solution is basic (copied from https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API), and everything is working fine.

But I have a problem when I set a grammar. My grammar contains ~2.000 words that are products name. When I use it, the whole speech recognition stop working and throws an error:

SpeechRecognitionErrorEvent {isTrusted: true, error: 'network', message: '', type: 'error' [...]}

This error starts as soon as my grammar contains 700 or more entries. If I reduce the amount of items below this threshold, everything is working fine.

Do you have any idea on how to bypass this issue, or any information about this 700 threshold (I couldn't find any documentation about it) as I would like to understand the root cause.

Most likely, I would switch to a dedicated Speech Recognition service through an API, as my use case is probably not adapted to the default javascript API, but I'm still curious to understand the root cause of my issue.

0

There are 0 answers