YSKSpeechRecognitionViewController class

#import <YSKSpeechRecognitionViewController.h>

View Controller for basic speech recognition integration.

YSKSpeechRecognitionViewController is designed to simplify the integration of speech recognition features into an app. The class returns the string uttered by the user and resolves any issues that occur along the way.

YSKSpeechRecognitionViewController manages the entire recognition process, including the user interface for speech recognition, management of the YSKRecognizer and YSKInitializer objects, and so on.

YSKSpeechRecognitionViewController uses YSKSpeechRecognitionViewControllerDelegate for notification of significant events in the recognition process.

Note.

SpeechKit must be initialized using YSKSpeechKit::configureWithAPIKey: before instantiating the first recognizer.

Note.

The recognizer directly and indirectly initializes and uses shared resources, so two instances of the YSKSpeechRecognitionViewController class may not exist simultaneously. A new recognizer can be created only after the current one has finished its work and called either YSKRecognizerDelegate::recognizer:didCompleteWithResults: or YSKRecognizerDelegate::recognizer:didFailWithError:.

Instance methods

- cancel

Cancels the recognition request.

- dealloc

Releases resources used by the recognizer.

- initWithLangauge:model:

Initializes a simplified single-use recognizer with a GUI (YSKSpeechRecognitionViewController).

- start

Starts the recognition process.

Class methods

+ isRecognitionAvailable

Checks whether the recognition is currently available.

Properties

delegate

The delegate will receive notifications when recording starts and finishes, recognition results are received, and errors occur.

Method descriptions

- cancel

- (void) cancel

Cancels the recognition request.

This method cancels the recognition request at any stage of the operation. Audio stops being recorded, and the network connection is terminated if necessary.
Note.

This method cancels the request asynchronously. This means that recognition does not end immediately after calling the method, and callbacks still might be invoked.

Note.

The method does not release the recognizer. The recognizer is destroyed automatically after either YSKRecognizerDelegate::recognizer:didFailWithError: or YSKRecognizerDelegate::recognizer:didCompleteWithResults: is called.

- dealloc

- (void) dealloc

Releases resources used by the recognizer.

- initWithLangauge:model:

- (instancetype) initWithLangauge:(NSString *) language
model:(NSString *) model

Initializes a simplified single-use recognizer with a GUI (YSKSpeechRecognitionViewController).

To start the recognition operation, call the start method.
Parameters:
language

recognition language

model

recognition model

Returns:

The created recognizer for performing recognition with the specified parameters.

+ isRecognitionAvailable

+ (BOOL) isRecognitionAvailable

Checks whether the recognition is currently available.

Note.

If initialization has not been completed, the function always returns YES.

- start

- (void) start

Starts the recognition process.

Property descriptions

delegate

(weak, readwrite) id< YSKSpeechRecognitionViewControllerDelegate > delegate

Delegate for notification about the progress of speech recognition

The delegate will receive notifications when recording starts and finishes, recognition results are received, and errors occur.