PhraseSpotter class

ru.yandex.speechkit

public  class  PhraseSpotter 

Class for voice activation.

Voice activation technology allows detecting set phrases in the audio stream. The list of phrases is in the voice activation model. The PhraseSpotter class contains static methods that allow loading and unloading a model and starting or stopping phrase detection.

Note.

Phrase detection can be performed continuously. It does not require an internet connection. All computations are performed on the device.

Methods

voidsetListener(PhraseSpotterListener listener)

Before launching voice activation, you need to pass the data for audio analysis to an object of the PhraseSpotterListener class that processes voice activation events.

ErrorsetModel(PhraseSpotterModel model)

Initializes PhraseSpotter.

Errorstart()

Starts PhraseSpotter.

Errorstop()

Stops PhraseSpotter asynchronously.

Method descriptions

setListener

public static void setListener (PhraseSpotterListener listener)

Before launching voice activation, you need to pass the data for audio analysis to an object of the PhraseSpotterListener class that processes voice activation events.

All callback methods will be called in the PhraseSpotter initialization stream.

setModel

public static Error setModel (PhraseSpotterModel model)

Initializes PhraseSpotter.

Returns:

An object of the Error class with results of execution.

start

public static Error start ()

Starts PhraseSpotter.

After this method is called, PhraseSpotter starts recording audio and searching for the specified phrases.
Note.

Before calling this method, you must initialize PhraseSpotter by calling the setModel() method.

Returns:

An object of the Error class with results of execution.

stop

public static Error stop ()

Stops PhraseSpotter asynchronously.

After calling this method, PhraseSpotter releases resources, including audio input, but doesn't unload the model from memory and can be started again.

Returns:

An object of the Error class with results of execution.