Class YSKOnlineRecognizer

Class for online speech recognition. Implements the YSKRecognizing protocol.

The object manages all recognition processes, voice activity detection, server communication, and so on. YSKOnlineRecognizer uses YSKRecognizerDelegate for notification of significant events that occur in the recognition process. Before working with an object of the YSKOnlineRecognizer class, set the developer's API key using the apiKey property.
Note.
When starting an object of the YSKOnlineRecognizer class with the default audio source or any other source that uses the standard device input, you should correctly configure the app's audio session. The YSKAudioSessionHandler class makes it easier to configure the audio session:
  • If your app uses an audio session only when working with the SpeechKit library, we recommend using this class to configure the audio session.

  • If your app uses the audio session outside the library (for audio and video playback, audio recording, and so on), you can also use this class or configure the audio session independently. If you decide to configure an audio session yourself, pay attention to the settings which may affect the operation of the YSKOnlineRecognizer class object (the audio session settings are described in the YSKAudioSessionHandler class). Without appropriate settings, the YSKOnlineRecognizer class object returns the YSKErrorAudioRecording error in the recognizer:didFailWithError: method. Possible error codes are listed in YSKErrorCode.

Instance Methods

-initWithSettings:

Initializes an object of the YSKOnlineRecognizer class with the specified settings.

-initWithSettings:audioSource:session:

Initializes an object of the YSKOnlineRecognizer class with the specified settings, audio source, and YSKUniProxySession class object.

-initWithSettings:session:

Initializes an object of the YSKOnlineRecognizer class with the specified settings and the YSKUniProxySession class object.

Properties

settings

Settings of an object of the YSKOnlineRecognizer class.

Method Detail

-initWithSettings:

- (instancetype)initWithSettings:(YSKOnlineRecognizerSettings *)settings 

Initializes an object of the YSKOnlineRecognizer class with the specified settings.

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

Settings of an object of the YSKOnlineRecognizer class.

Returns:

An object of the YSKOnlineRecognizer class.

-initWithSettings:audioSource:session:

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

Initializes an object of the YSKOnlineRecognizer class with the specified settings, audio source, and YSKUniProxySession class object.

If the audio source uses the standard device input, you should correctly configure the app's audio session either through the YSKAudioSessionHandler class or independently. The session parameter allows using multiple components within a single network connection. This method is a designated initializer for the YSKOnlineRecognizer class.
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.

Returns:

An object of the YSKOnlineRecognizer class.

-initWithSettings:session:

- (instancetype)initWithSettings:(YSKOnlineRecognizerSettings *)settings
                         session:(YSKUniProxySession *)session 

Initializes an object of the YSKOnlineRecognizer class with the specified settings and the YSKUniProxySession class object.

YSKAutoAudioSource will be used as an audio source. To enable it, correctly configure the app's audio session either through the YSKAudioSessionHandler class or independently.
Note.

Use this method if you need to explicitly specify the session that online recognition will work with. This is necessary if you want to use a single network connection for multiple components.

Parameters:
settings

Settings of an object of the YSKOnlineRecognizer class.

session

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

Returns:

An object of the YSKOnlineRecognizer class.