Protocol YSKRecognizerDialogControllerDelegate

The protocol defines the callbacks of the delegate that is called by the YSKRecognizerDialogController dialog.

These methods are called during the recognition lifecycle. The delegate is notified when the recognition result is received, an error occurs, and the dialog is closed.

Instance Methods

-recognizerDialogController:didFailWithError:

Called if the recognition process failed with an error and the problem cannot be fixed by the user.

-recognizerDialogController:didFinishWithResult:

Called when the recognition process completes successfully.

-recognizerDialogControllerDidClose:automatically:

Called when the dialog is closed.

-recognizerDialogControllerDidFinishAudioProcessing:

Called when the dialog finished working with the audio.

Method Detail

-recognizerDialogController:didFailWithError:

- (void)recognizerDialogController:(YSKRecognizerDialogController *)controller
                  didFailWithError:(NSError *)error 

Called if the recognition process failed with an error and the problem cannot be fixed by the user.

The method is called before the end of the animation for closing the dialog.
Parameters:
controller

Object of the YSKRecognizerDialogController class that called the method.

error

Error during speech recognition.

-recognizerDialogController:didFinishWithResult:

- (void)recognizerDialogController:(YSKRecognizerDialogController *)controller
               didFinishWithResult:(NSString *)result 

Called when the recognition process completes successfully.

The method is called if speech was recognized successfully. Otherwise, the error screen will be displayed if the problem can be fixed by the user (for example, "I can't hear you") or if the recognizerDialogController:didFailWithError: method is called. The method is called before the end of the animation for closing the dialog.
Parameters:
controller

Object of the YSKRecognizerDialogController class that called the method.

result

A string containing the recognition result.

-recognizerDialogControllerDidClose:automatically:

- (void)recognizerDialogControllerDidClose:(YSKRecognizerDialogController *)controller
                             automatically:(BOOL)automatically 

Called when the dialog is closed.

The method is called at the end of the animation for closing the dialog. The dialog closes automatically when recognition results are received or an error occurs. The user can close the dialog without waiting for recognition results by clicking on the darkened area of the screen or swiping down the dialog.
Parameters:
controller

Object of the YSKRecognizerDialogController class that called the method.

automatically

Dialog closing option (automatically or by the user). Acceptable values: YES - the dialog was closed automatically when getting recognition results; NO - the dialog was closed by the user.

-recognizerDialogControllerDidFinishAudioProcessing:

- (void)recognizerDialogControllerDidFinishAudioProcessing:(YSKRecognizerDialogController *)controller 

Called when the dialog finished working with the audio.

The dialogue uses audio inputs and outputs for recording an audio through an object of the YSKOnlineRecognizer class and for playing sounds indicating the start of recording, an error, or closing of the dialog. The audio may finish playing a little later than the dialog itself closes. You can change the audio session settings in this method. The method can be called before or after calling the recognizerDialogControllerDidClose:automatically: method.
Parameters:
controller

Object of the YSKRecognizerDialogController class that called the method.