YSKSpeechRecognitionViewController class

#import <YSKSpeechRecognitionViewController.h>

Ready-to-use View Controller for speech recognition.

YSKSpeechRecognitionViewController makes it easier to embed speech recognition in an app.

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.

-initWithLanguage:model:

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

-initWithModel:

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

Delegate for notification about the progress of speech recognition.

partialResultsDisplayEnabled

If set to YES, incomplete recognition results are returned.

resultsListDisplayEnabled

If set to YES, a list of recognition results is returned.

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.

-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. For supported values, see the section Recognition languages.

model

Model for recognition. Possible values are listed in the section Language models for recognition.

Returns:

The created recognizer (for recognition in the specified language).

-initWithModel:

- (instancetype) initWithModel:(NSString *) model

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

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

Model for recognition. Possible values are listed in the section Language models for recognition.

Returns:

The created recognizer. The recognition language can be selected in dialog mode.

+isRecognitionAvailable

+ (BOOL) isRecognitionAvailable

Checks whether the recognition is currently available.

Note.

If initialization has not been completed, the method 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.

partialResultsDisplayEnabled

(assign, readwrite) BOOL partialResultsDisplayEnabled

If set to YES, incomplete recognition results are returned.

resultsListDisplayEnabled

(assign, readwrite) BOOL resultsListDisplayEnabled

If set to YES, a list of recognition results is returned.