Class YSKRecognizerProxy

A switch class between the SpeechKit library online recognition and the Speech system framework.

The class specifies a list of languages that will be recognized by the SpeechKit library. If the passed language is not on the list, speech will be recognized using the Speech system framework. If the passed language is on the list but not supported by the SpeechKit library, an error will be returned in the recognizer:didFailWithError: method.
Note.

This functionality is available starting from iOS 10.0.

Instance Methods

Method Detail

-initWithSettings:audioSource:session:supportedLanguages:

- (instancetype)initWithSettings:(YSKOnlineRecognizerSettings *)settings
                     audioSource:(id< YSKAudioSource >)audioSource
                         session:(YSKUniProxySession *)session
              supportedLanguages:(NSArray< YSKLanguage * > *)languages 

Initializes an object of the YSKRecognizerProxy class.

This method is a designated initializer for the YSKRecognizerProxy class. If the passed audio source uses the standard device input, you should configure the app's audio session correctly. For that, use the YSKAudioSessionHandler class or configure the audio session independently for correct audio recording. The session parameter allows using multiple components within a single network connection.
Parameters:
settings

Settings of an object of the YSKOnlineRecognizer class.

audioSource

Source that passes an audio for recognition to an object of the YSKOnlineRecognizer class.

session

An object of the YSKUniProxySession class that will be used for a network connection.

languages

List of languages that will be recognized by the SpeechKit library

Returns:

An object of the YSKRecognizerProxy class.

-initWithSettings:supportedLanguages:

- (instancetype)initWithSettings:(YSKOnlineRecognizerSettings *)settings
              supportedLanguages:(NSArray< YSKLanguage * > *)languages 

Initializes an object of the YSKRecognizerProxy class.

YSKAutoAudioSource will be used as an audio source. To enable it, correctly configure the app's audio session. For that, use the YSKAudioSessionHandler class or configure the audio session independently for correct audio recording. The YSKUniProxySession will also be automatically created inside to work with the network.
Parameters:
settings

Settings of an object of the YSKOnlineRecognizer class.

languages

List of languages that will be recognized by the SpeechKit library.

Returns:

An object of the YSKRecognizerProxy class.