YSKSpeechKit class

#import <YSKSpeechKit.h>

Singleton class aimed at setting up and controlling overall SpeechKit operation.

You don't need to explicitly create or destroy instances of the YSKSpeechKit class. To access an object, use the sharedInstance method, which creates an instance of the YSKSpeechKit class when called for the first time. This instance is destroyed when the app closes.

Instance methods

-configureWithAPIKey:

Configuring SpeechKit.

-configureWithAPIKey:andLocationProvider:

Configuring SpeechKit (with access to geolocation).

-getAPIKey

Returns the value of the API key.

-getParameterValue:

Returns the values of internal SpeechKit library parameters set by the user.

-getSupportedLanguages:

Returns a list of languages that the specified model supports.

-getUuid

Returns the UUID — the ID that was used in the recognition request. It is unique for each user of the app or service.

-setLogLevel:

Sets the logging level.

-setParameter:withValue:

Sets internal SpeechKit library parameters.

Class methods

+sharedInstance

Returns a shared instance of the YSKSpeechKit class.

+speechkitVersion

Returns the SpeechKit version.

Method descriptions

-configureWithAPIKey:

- (void) configureWithAPIKey:(NSString *) apiKey

Configuring SpeechKit.

The method should be called before beginning to use any SpeechKit functionality (for example, before creating instances of YSKRecognizer).
Parameters:
apiKey

The API key provided by Yandex.

Note.

The API key is verified when working with the server (such as during initialization). The key validation process may finish with the error kYSKErrorAPIKey.

-configureWithAPIKey:andLocationProvider:

- (void) configureWithAPIKey:(NSString *) apiKey
andLocationProvider:(id< YSKLocationProvider >) locationProvider

Configuring SpeechKit (with access to geolocation).

The method should be called before beginning to use any SpeechKit functionality (for example, before creating instances of YSKRecognizer).
Parameters:
apiKey

The API key provided by Yandex.

locationProvider

Object that gives the library access to geolocation. Information about the user's current location may be used for determining the most likely hypotheses, for example, when using the maps language model.

To disable geolocation, pass an empty attribute as the second parameter.
Note.

The API key is verified when working with the server (such as during initialization). The key validation process may finish with the error kYSKErrorAPIKey.

Note.

If SpeechKit was configured using a different version of configureWithAPIKey:, the default value will be used for working with geolocation.

-getAPIKey

- (NSString *) getAPIKey

Returns the value of the API key.

-getParameterValue:

- (NSString *) getParameterValue:(NSString *) name

Returns the values of internal SpeechKit library parameters set by the user.

-getSupportedLanguages:

- (NSArray *) getSupportedLanguages:(NSString *) model

Returns a list of languages that the specified model supports.

Parameters:
model

Model name.

Returns:

List of languages.

-getUuid

- (NSString *) getUuid

Returns the UUID — the ID that was used in the recognition request. It is unique for each user of the app or service.

-setLogLevel:

- (void) setLogLevel:(YSKLogLevel) logLevel

Sets the logging level.

-setParameter:withValue:

- (void) setParameter:(NSString *) name
withValue:(NSString *) value

Sets internal SpeechKit library parameters.

For available parameters, see the section Global constants.
Parameters:
name

Name of an internal parameter.

value

Value of an internal parameter.

+sharedInstance

+ (instancetype) sharedInstance

Returns a shared instance of the YSKSpeechKit class.

Returns:

A shared instance of the YSKSpeechKit class.

+speechkitVersion

+ (NSString *) speechkitVersion

Returns the SpeechKit version.

Returns:

String representation of the SpeechKit version number.