SpeechRecognizerButton icon indicating copy to clipboard operation
SpeechRecognizerButton copied to clipboard

SFButtonError error 3

Open wawilliams003 opened this issue 4 years ago • 9 comments

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
        }

wawilliams003 avatar Jul 15 '19 12:07 wawilliams003

What error are you getting? (From this enum)

alexruperez avatar Jul 15 '19 13:07 alexruperez

@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?

wawilliams003 avatar Jul 15 '19 13:07 wawilliams003

I mean the value in the enum, when debugging. If it's error 3, maybe your are using a invalid(locale: Locale)?

alexruperez avatar Jul 15 '19 13:07 alexruperez

I set the locale, but still getting the same error.

speechRecognizerBtn.locale = .current

wawilliams003 avatar Jul 15 '19 15:07 wawilliams003

Have you NSMicrophoneUsageDescription and NSSpeechRecognitionUsageDescription declared in your app Info.plist?

alexruperez avatar Jul 15 '19 15:07 alexruperez

Yes, I added those and I think the app would've crashed if I didn't or give a more descriptive error.

wawilliams003 avatar Jul 15 '19 15:07 wawilliams003

hi, I am getting same error do you have a solution for this?

Gagan6696 avatar Jul 22 '19 07:07 Gagan6696

I have improved the error feedback in the example app, try the new version 0.2.0 to see what's happening please. Thanks.

alexruperez avatar Aug 15 '19 14:08 alexruperez

The problem still exists but error 5

ShKhan9 avatar Feb 03 '21 22:02 ShKhan9