PhraseSpotter class

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.


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.


Error initialize(String configPath, PhraseSpotterListener listener)

Initializes PhraseSpotter.

Error start()

Starts PhraseSpotter.

Error stop()

Stops PhraseSpotter.

Error uninitialize()

Deinitializes PhraseSpotter.

Method descriptions


public static Error initialize (String configPath, PhraseSpotterListener listener)

Initializes PhraseSpotter.

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

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


Path to the directory containing the model files.


Object that will get messages from PhraseSpotter.


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.


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.


public static Error uninitialize ()

Deinitializes PhraseSpotter.

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