YSKSpeechRecognitionViewControllerDelegate protocol

#import <YSKSpeechRecognitionViewControllerDelegate.h>

The protocol defines the callback methods of the delegate that is called by an instance of the YSKSpeechRecognitionViewController class.

These methods are called during the recognition lifecycle. The delegate will be notified when the recognition process starts and finishes (successfully or with an error).

Instance methods

-speechRecognitionViewController:didChangeLanguage:

Called when changing the recognition language.

-speechRecognitionViewController:didFailWithError:

Called if the recognition process failed with an error.

-speechRecognitionViewController:didFinishWithResult:

Called when the recognition process completes successfully.

Method descriptions

-speechRecognitionViewController:didChangeLanguage:

- (void) speechRecognitionViewController:(YSKSpeechRecognitionViewController *) speechRecognitionViewController
didChangeLanguage:(NSString *) language

Called when changing the recognition language.

Parameters:
language

New recognition language. For supported values, see the section Recognition languages.

-speechRecognitionViewController:didFailWithError:

- (void) speechRecognitionViewController:(YSKSpeechRecognitionViewController *) speechRecognitionViewController
didFailWithError:(NSError *) error

Called if the recognition process failed with an error.

Various errors may occur during recognition. Some of them are handled by the recognizer itself, but not all of them are. This method is called only if the recognizer can't fix the error, or the user canceled the request. The method is called only if recognition finished with an error. Otherwise, speechRecognitionViewController:didFinishWithResult: is called.
Parameters:
error

Error during speech recognition.

-speechRecognitionViewController:didFinishWithResult:

- (void) speechRecognitionViewController:(YSKSpeechRecognitionViewController *) speechRecognitionViewController
didFinishWithResult:(NSString *) result

Called when the recognition process completes successfully.

This is the mechanism that the recognizer uses for providing recognition results. The method is called only if speech was recognized successfully. Otherwise, speechRecognitionViewController:didFailWithError: is called.
Parameters:
result

A string containing the recognition result.