JamesBrill / react-speech-recognition

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

Transcript multiple language #27

Closed ramthenmala closed 4 years ago

ramthenmala commented 4 years ago

Hi,

first of all great to this react plugin. I would like to have an option to choose language from dropdown and according to that the transcription should work. Is there any way to do that?

Thanks in advance

JamesBrill commented 4 years ago

Hi @webbieram React Speech Recognition will inject a prop into your component called recognition (see this). You can set the language used by Speech Recognition by assigning a language value to the lang property on this object. This value must be a valid BCP 47 language tag (as required here).

You could do the following: