JamesBrill / react-speech-recognition

💬Speech recognition for your React app
https://webspeechrecognition.com/
MIT License
695 stars 122 forks source link

getting error right after startListening on mobile #26

Closed Desintegrator closed 4 years ago

Desintegrator commented 4 years ago

It works on desktop, but in mobile i get onend callback right after startListening. I manually added onerror callback and it's says that it's some network error happens. But network is on. Same problem in different devices

SpeechRecognitionErrorEvent isTrusted: true error: "network" message: "" type: "error" target: SpeechRecognition {grammars: SpeechGrammarList, lang: "ru-RU", continuous: false, interimResults: true, maxAlternatives: 1, …} currentTarget: SpeechRecognition {grammars: SpeechGrammarList, lang: "ru-RU", continuous: false, interimResults: true, maxAlternatives: 1, …} eventPhase: 0 bubbles: false cancelable: false defaultPrevented: false composed: false timeStamp: 15449.699999997392 srcElement: SpeechRecognition {grammars: SpeechGrammarList, lang: "ru-RU", continuous: false, interimResults: true, maxAlternatives: 1, …} returnValue: true cancelBubble: false path: [] __proto__: SpeechRecognitionErrorEvent

Desintegrator commented 4 years ago

it can be fixed by "autoStart:true" option, but i don't need that

Desintegrator commented 4 years ago

The problem is because of getUserMedia call getting audio stream. Is there a workaround to use speech recognition in parallel?

JamesBrill commented 4 years ago

Which browser and device are you using? You can check the compatibility table in Browser compatibility here.