Initializer class

ru.yandex.speechkit

public  class  Initializer 

Class that initializes the library.

Initialization is a process for initializing internal SpeechKit mechanisms.

The initializer sends a request to the server and gets a set of parameters and configurations in response (such as the audio format or parameters of the active voice detection algorithm), which are then used by other library components.

You don't have to perform explicit initialization. SpeechKit initializes automatically when it receives the first request for speech recognition or synthesis. However, initialization may take a considerable time, because it involves reading from permanent memory and network requests. To reduce the time for executing the first request, perform initialization before using other library components.

Note.

The initializer is designed to carry out a single startup and may not be reused.

Note.

Before creating Initializer objects, you must call SpeechKit.configure().

Methods

Initializercreate(InitializerListener listener)

Creates a single-use initializer.

booleanisInitializationCompleted()

Checks whether the initialization process is completed.

voidstart()

Starts the initialization process.

Method descriptions

create

public static Initializer create (InitializerListener listener)

Creates a single-use initializer.

To start the initialization process, call the start method.
Parameters:
listener

Object that will receive notifications about the progress of initialization. Receives notifications about the start, end, and errors during initialization.

Returns:

The created initializer.

isInitializationCompleted

public static boolean isInitializationCompleted ()

Checks whether the initialization process is completed.

Returns:

true — initialization completed; false — initialization not completed.

start

public void start ()

Starts the initialization process.