@geneg1 I got the simulator to work but I'm seeing a gazillion error messages as well. how did you separate instantiating the SFSpeechRecognizer and calling SFSpeechRecog nizer.requestAuthorization()? I'm performing both in the initialiser of the SpeechRecognizer actor and can't seem to separate them.
< init() {
recognizer = SFSpeechRecognizer()
guard recognizer != nil else {
transcribe(RecognizerError.nilRecognizer)
return
}
Task {
do {
guard await SFSpeechRecognizer.hasAuthorizationToRecognize() else {
throw RecognizerError.notAuthorizedToRecognize
}
guard await AVAudioSession.sharedInstance().hasPermissionToRecord() else {
throw RecognizerError.notPermittedToRecord
}
} catch {
transcribe(error)
}
}
} >
Topic:
Programming Languages
SubTopic:
Swift
Tags: