Closed melounek closed 3 years ago
Hi @melounek The default Web Speech API only supports the transcription of one language at a time - hence, this is a global property. It also does not provide any kind of language detection. For something like that, you will need to use a different Speech Recognition service, one with some more advanced machine learning features under the hood. Alternatively, you could require that users manually specify which languages they want transcription in and switch between them when they finish speaking, for example.
I recently made a release of this library that supports polyfills. One such polyfill supports Azure Cognitive Services, which looks like it has some kind of language detection functionality. It may be possible that you can combine all these together to get the result you want. I'm not sure that polyfill exposes the language detection feature yet, so you may need to raise an issue or PR with them.
Hope that helps!
Right, I didn't see it is the global property so I will have to figure out something else.
Thanks for the polyfill.
And just FYI: I didn't really find out how to work with the authorizationToken
to avoid exposing subscriptionKey In neither your's, compulim's or azure's docs.
I would like to simultaneously transcript the voice in more language at once so I can also detect the language this way.
That's why I am wondering why there are the global variables
recognitionManager
andSpeechRecognition
because if they would be store as a state of the hook, it would be possible to create as many instances as I need.so the questions are:
or is there other approach how could I transcript in two or three languages simultaneously? (but that's just one use-case and maybe the refactoring would be beneficial for other use-cases too)
I will be happy to try to do a PR, but if you know about something why it have to be like that so it would be just waste of time.