PhraseSpotter class

ru.yandex.speechkit

public  class  PhraseSpotter 

Class that provides voice activation.

Voice activation technology allows continual analysis of an audio stream to detect specific phrases in it. It does not require an internet connection. All computations are performed on the device.

Note.

To search for phrases in an audio stream, you need to get a model that contains the pronunciation of these phrases.

PhraseSpotter provides static methods that allow loading and unloading a model and starting or stopping phrase detection.

Methods

Method descriptions

initialize

public static Error initialize (String configPath, PhraseSpotterListener listener)

Initializes PhraseSpotter.

This method loads the model to memory and sets the delegate.
Note.

Loading the model may take some time. The speed depends on the speed and size of the media where the model is located.

Parameters:
configPath

Path to the directory containing the model files.

listener

Object that will get messages from PhraseSpotter.

start

public static Error start ()

Starts PhraseSpotter.

After this method is called, PhraseSpotter starts recording audio and searching for the specified phrases. Before calling this method, PhraseSpotter must be initialized.

stop

public static Error stop ()

Stops PhraseSpotter.

PhraseSpotter stops recording audio, but does not unload the model from memory. The process can be resumed later without reinitializing PhraseSpotter.

uninitialize

public static Error uninitialize ()

Deinitializes PhraseSpotter.

Unloads the model from memory and sets the listener pointer to null.