I am building a search that supports voice recognition and transforms speech to text so I am using SFSpeechRecognizer
. But the problem is that I need to support multiple languages at the same time such as ("en_US
", "fr
", vi
, ar
).
The main idea is that the user can speak for example 1 word in English and the other in French and I want the engine to detect this.
Currently, I am using this to set my main language
ENGLISH:
private let speechRecognizer = SFSpeechRecognizer(locale: Locale.init(identifier: "en_US"))!
FRENCH:
private let speechRecognizer = SFSpeechRecognizer(locale: Locale.init(identifier: "fr"))!
Every language I need to set it separately.
Is there a way so SFSpeechRecognizer
supports multiple languages at the same time?