YSKPhraseSpotter class

#import <YSKPhraseSpotter.h>

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 YSKPhraseSpotter class contains class 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.

Class methods

+isRunning

Returns the state of YSKPhraseSpotter.

+setDelegate:

The delegate that receives notification when the voice activation process starts and finishes if the set phrases or errors are detected.

+setModel:

Sets the voice activation model.

+start

Starts YSKPhraseSpotter.

+stop

Stops the voice activation process.

Method descriptions

+isRunning

+ (BOOL) isRunning

Returns the state of YSKPhraseSpotter.

+setDelegate:

+ (void) setDelegate:(id< YSKPhraseSpotterDelegate >) delegate

The delegate that receives notification when the voice activation process starts and finishes if the set phrases or errors are detected.

Parameters:
delegate

The delegate for voice activation callback methods.

+setModel:

+ (NSError *) setModel:(YSKPhraseSpotterModel *) model

Sets the voice activation model.

Returns:

Results of execution.

+start

+ (NSError *) start

Starts YSKPhraseSpotter.

Returns:

Results of execution.

After YSKPhraseSpotter starts, audio recording begins and the specified phrases are searched for. Before calling this method, you must initialize YSKPhraseSpotter by sending the setModel: message.

+stop

+ (NSError *) stop

Stops the voice activation process.

Returns:

Results of execution.

YSKPhraseSpotter stops recording audio, but does not unload the model from memory. It can be started agin in the future without re-initialization.