SpeechKit class

ru.yandex.speechkit

public class SpeechKit 

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

SpeechKit objects should not be explicitly created or destroyed by the user. To access the object, use the SpeechKit.getInstance() method, which creates the SpeechKit object when called for the first time. This object is destroyed when the app closes.

Methods

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

Configuring SpeechKit.

SpeechKitgetInstance()

Returns a shared instance of the SpeechKit class.

StringgetParameter(String name)

Returns the values for internal parameters of the SpeechKit library.

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 the SpeechKit functionality (for example, before creating instances of the Recognizer class).
Parameters:
context

application context

apiKey

The API key provided by Yandex. For more information about keys, see the section "apikeys".

Note.

The API key is validated when working with the backend (for example, when performing initialization), which might fail with the error Error.ERROR_API_KEY.

getInstance

public static SpeechKit getInstance ()

Returns a shared instance of the SpeechKit class.

Returns:

a shared instance of the SpeechKit class.

getParameter

public String getParameter (String name)

Returns the values for internal parameters of the SpeechKit library.

Parameters:
name

name of the internal parameter

Returns:

Value of the 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 the internal parameter

value

internal parameter