Interface PhraseSpotterListener

ru.yandex.speechkit

public  interface  PhraseSpotterListener 

The interface defines callback methods to track voice activation events.

Methods

voidonPhraseSpotted(@NonNull final PhraseSpotter phraseSpotter, @NonNull final String phrase, final int phraseId)

Called when the audio stream contains a phrase that is present in the enabled voice activation model (activation command).

voidonPhraseSpotterError(@NonNull final PhraseSpotter phraseSpotter, @NonNull final Error error)

Called if an error occurs during voice activation.

voidonPhraseSpotterStarted(@NonNull final PhraseSpotter phraseSpotter)

Called when audio recording starts.

Method Detail

onPhraseSpotted

public void onPhraseSpotted (@NonNull final PhraseSpotter phraseSpotter, @NonNull final String phrase, final int phraseId)

Called when the audio stream contains a phrase that is present in the enabled voice activation model (activation command).

Note.

The PhraseSpotter class object does not release audio resources when calling this method. If you need to stop the PhraseSpotter class object, call the stop () method.

Parameters:
phraseSpotter

Link to the object of the PhraseSpotter class that invoked the method.

phrase

Recognized phrase.

phraseId

Index (number) of the activation command.

onPhraseSpotterError

public void onPhraseSpotterError (@NonNull final PhraseSpotter phraseSpotter, @NonNull final Error error)

Called if an error occurs during voice activation.

Parameters:
phraseSpotter

Link to the object of the PhraseSpotter class that invoked the method.

error

An error that occurred during the operation.

onPhraseSpotterStarted

public void onPhraseSpotterStarted (@NonNull final PhraseSpotter phraseSpotter)

Called when audio recording starts.

Parameters:
phraseSpotter

Link to the object of the PhraseSpotter class that invoked the method.