SpeechKit class

ru.yandex.speechkit

public  class  SpeechKit 

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

SpeechKit objects do not need to be created or destroyed explicitly. To access the object, call the SpeechKit.getInstance method, which creates the SpeechKit object when called for the first time. This object is destroyed when the app closes.

Nested classes

Methods

voidconfigure(android.content.Context context, String apiKey)

Configuring SpeechKit.

voidconfigure(android.content.Context context, String apiKey, LocationProvider locationProvider)

Configuring SpeechKit (with access to geolocation).

SpeechKitgetInstance()

Returns a shared instance of the SpeechKit class.

StringgetParameter(String name)

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

StringgetVersion()

Returns the SpeechKit version.

voidsetParameter(String name, String value)

Sets internal SpeechKit library parameters.

Method descriptions

configure

public void configure (android.content.Context context, String apiKey)

Configuring SpeechKit.

This method must be called before using any of the SpeechKit functionality (before creating instances of the Recognizer class).
Parameters:
context

Application context.

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 Error.ERROR_API_KEY.

configure

public void configure (android.content.Context context, String apiKey, LocationProvider locationProvider)

Configuring SpeechKit (with access to geolocation).

This method must be called before using any of the SpeechKit functionality (before creating instances of the Recognizer class).
Parameters:
context

Application context.

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, such as when using the Recognizer.Model.maps language model.

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

The API Key is validated when working with the server (such as during initialization). The key validation process may finish with the error Error.ERROR_API_KEY.

Note.

If SpeechKit was configured by calling a different version of SpeechKit.configure, the default value will be used for working with geolocation.

getInstance

public static SpeechKit getInstance ()

Returns a shared instance of the SpeechKit class.

Returns:

Shared instance of the SpeechKit class.

getParameter

public String getParameter (String name)

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

Parameters:
name

Name of an internal parameter.

Returns:

Value of an internal parameter.

getVersion

public static String getVersion ()

Returns the SpeechKit version.

Returns:

String representation of the SpeechKit version number.

setParameter

public void setParameter (String name, String value)

Sets internal SpeechKit library parameters.

Parameters:
name

Name of an internal parameter.

value

Value of an internal parameter.