Closed dgastudio closed 3 years ago
You could pass the googleCloudRecognitionConfig
arg to the hook to specify the language code for cross-browser mode
googleCloudRecognitionConfig: {
languageCode: 'en-US'
}
This language code will only apply for the browsers that don't support the native browser speech API
Read more here https://github.com/Riley-Brown/react-speech-to-text#googlecloudrecognitionconfig
Hello Riley!
Thank you for your response! But, i don't want to use google cloud. Instead, i want to set language in native mode as i can see, it's possible, https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/lang
how to apply this functionality in your plugin?
@dgastudio Yes it is also possible to specify the language for native chrome recognition with the speechRecognitionProperties
speechRecognitionProperties: {
lang: 'es',
}
However, I would not recommend hardcoding a value here as the MDN docs state
If not specified, this defaults to the HTML lang attribute value, or the user agent's language setting
So this setting should be automatically set based on the user's browser language settings
awesome, thank you!
Hey I have chrome in English, but I would like to define Spanish as well.
it's possible to change the language in cross-browser mode, but not in "native"
any advice? thanks