JamesBrill / react-speech-recognition

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

Voice recognition does not work when polyfill is applied in React #115

Closed daehyunkim73 closed 2 years ago

daehyunkim73 commented 2 years ago

I am developing speech recognition in React. However, when applying the following polyfill, voice recognition is not available. The problem code followed the guidelines.

const appId = 'app id number'; const SpeechlySpeechRecognition = createSpeechlySpeechRecognition(appId); SpeechRecognition.applyPolyfill(SpeechlySpeechRecognition);

English voice is recognized but other languages ​​don't work Is there anything we missed? Is there anything I need to configure about polyfills in React? Here's the full code...

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Issue Code ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: import { createSpeechlySpeechRecognition } from '@speechly/speech-recognition-polyfill'; import SpeechRecognition, { useSpeechRecognition } from 'react-speech-recognition';

const appId = API_KEY; const SpeechlySpeechRecognition = createSpeechlySpeechRecognition(appId); SpeechRecognition.applyPolyfill(SpeechlySpeechRecognition);

1) const startListening = () => SpeechRecognition.startListening({ continuous: continuousGbn, language: 'en' }); 2) const startListening = () => SpeechRecognition.startListening({ continuous: continuousGbn, language: 'ko' }); 3) const startListening = () => SpeechRecognition.startListening({ continuous: continuousGbn, language: 'de' }); ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

JamesBrill commented 2 years ago

Hi @daehyunkim73 Last time I checked, Speechly does not currently support languages other than English, at least not in the API used in their polyfill (see polyfill caveats). They are looking into adding more languages though. From my experience, they are responsive to feedback - perhaps you can check in on the progress of multi-language support here. I'll also drop them a message. 🙂

JamesBrill commented 2 years ago

Closed due to inactivity.