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 phrases are detected in the audio stream.

voidonPhraseSpotterError(Error error)

Called if an error occurs while PhraseSpotter is working.

voidonPhraseSpotterStarted()

Called when audio recording starts.

voidonPhraseSpotterStopped()

Called when audio recording stops.

Method descriptions

onPhraseSpotted

public void onPhraseSpotted (String phrase, int phraseId)

Called when phrases are detected in the audio stream.

Note.

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

Note.

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

Parameters:
phrase

Phrase.

phraseId

Phrase index.

onPhraseSpotterError

public void onPhraseSpotterError (Error error)

Called if an error occurs while PhraseSpotter is working.

Parameters:
error

Error.

onPhraseSpotterStarted

public void onPhraseSpotterStarted ()

Called when audio recording starts.

onPhraseSpotterStopped

public void onPhraseSpotterStopped ()

Called when audio recording stops.