YSKPhraseSpotterDelegate protocol

#import <YSKPhraseSpotterDelegate.h>

The protocol defines the callbacks of the delegate that is called by YSKPhraseSpotter.

Instance methods

-phraseSpotterDidFailWithError:

Called if an error occurs while YSKPhraseSpotter is working.

-phraseSpotterDidSpotPhrase:withIndex:

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

-phraseSpotterDidStarted

Called when voice activation is started.

-phraseSpotterDidStopped

Called when voice activation is stopped.

Method descriptions

-phraseSpotterDidFailWithError:

- (void) phraseSpotterDidFailWithError:(NSError *) error

Called if an error occurs while YSKPhraseSpotter is working.

Parameters:
error

Error.

-phraseSpotterDidSpotPhrase:withIndex:

- (void) phraseSpotterDidSpotPhrase:(NSString *) phrase
withIndex:(int) phraseIndex

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

Note.

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

Note.

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

Parameters:
phrase

Phrase.

phraseIndex

The index (number) of the activation command.

-phraseSpotterDidStarted

- (void) phraseSpotterDidStarted

Called when voice activation is started.

Note.

When audio recording begins.

-phraseSpotterDidStopped

- (void) phraseSpotterDidStopped

Called when voice activation is stopped.

Note.

When audio recording ends.