SpeechRecognizerButton
SpeechRecognizerButton copied to clipboard
SFButtonError error 3
Thanks for this Libary, I am trying to get it to work by following your example. That doesn't give a very clear explanation of how to use this. I set up the waveform and button through storyboard, but I am getting this error: "The operation couldn’t be completed. (SpeechRecognizerButton.SFButton.SFButtonError error 3.)"
This is how I am setting it up, add in viewDidload:
speechRecognizerBtn.authorizationErrorHandling = .custom(handler: { (error) in
print("error Authorizing \(String(describing: error?.localizedDescription))")
})
speechRecognizerBtn.resultHandler = {
recordUrl, result in
self.speechRecognizerBtn.play()
print("result \(String(describing: result?.bestTranscription.formattedString))")
}
speechRecognizerBtn.errorHandler = { error in
print("error \(String(describing: error?.localizedDescription))")
//self.label.text = $0?.localizedDescription
}
What error are you getting? (From this enum)
@alexruperez Thanks for your fast response, this is the error I am getting: The operation couldn’t be completed. (SpeechRecognizerButton.SFButton.SFButtonError error 3.)
I don't know why, do you know how I can resolve this?
I mean the value in the enum, when debugging. If it's error 3, maybe your are using a invalid(locale: Locale)?
I set the locale, but still getting the same error.
speechRecognizerBtn.locale = .current
Have you NSMicrophoneUsageDescription
and NSSpeechRecognitionUsageDescription
declared in your app Info.plist?
Yes, I added those and I think the app would've crashed if I didn't or give a more descriptive error.
hi, I am getting same error do you have a solution for this?
I have improved the error feedback in the example app, try the new version 0.2.0 to see what's happening please. Thanks.
The problem still exists but error 5