PhraseSpotterListener interface

ru.yandex.speechkit

public  interface  PhraseSpotterListener 

The interface defines callback methods for tracking voice activation events.

Methods

voidonPhraseSpotted(String phrase, int phraseId)

Called when the audio stream has phrases that are contained in the enabled voice activation model (activation commands).

voidonPhraseSpotterError(Error error)

Called if an error occurs while PhraseSpotter is working.

voidonPhraseSpotterStarted()

Called when voice activation is started.

voidonPhraseSpotterStopped()

Called when voice activation is stopped.

Method descriptions

onPhraseSpotted

public void onPhraseSpotted (String phrase, int phraseId)

Called when the audio stream has phrases that are contained in the enabled voice activation model (activation commands).

Note.

PhraseSpotter does not release audio resources when this method is being called. If necessary, you can stop PhraseSpotter by calling the PhraseSpotter.stop method.

Note.

Avoid locking in this method, because PhraseSpotter calls it in the same stream as it records audio in.

Parameters:
phrase

Phrase.

phraseId

The index (number) of the activation command.

onPhraseSpotterError

public void onPhraseSpotterError (Error error)

Called if an error occurs while PhraseSpotter is working.

Parameters:
error

Error.

onPhraseSpotterStarted

public void onPhraseSpotterStarted ()

Called when voice activation is started.

Note.

When audio recording begins.

onPhraseSpotterStopped

public void onPhraseSpotterStopped ()

Called when voice activation is stopped.

Note.

When audio recording ends.