YSKSpeechRecognitionViewController class

#import <YSKSpeechRecognitionViewController.h>

View Controller for basic speech recognition integration.

YSKSpeechRecognitionViewController makes it easier to embed speech recognition in an app. The class returns the string uttered by the user and resolves any problems 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 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 working and called either recognizer:didCompleteWithResults: or recognizer:didFailWithError:.

Instance methods

-cancel

Cancels the recognition request.

-dealloc

Releases resources used by the recognizer.

-initWithLanguage:model:

Initializes a simplified single-use recognizer with the YSKSpeechRecognitionViewController GUI.

-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 will be destroyed automatically after recognizer:didCompleteWithResults: or recognizer:didFailWithError: is called.

-dealloc

- (void) dealloc

Releases resources used by the recognizer.

-initWithLanguage:model:

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

Initializes a simplified single-use recognizer with the YSKSpeechRecognitionViewController GUI.

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

Language for recognition.

model

Model for recognition.

Returns:

The created recognizer (for 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.