YSKPhraseSpotter class

#import <YSKPhraseSpotter.h>

Class that provides voice activation.

Voice activation technology allows continual analysis of an audio stream to detect specific phrases in it. It does not require an internet connection. All computations are performed on the device.


To search for phrases in an audio stream, you need to get a model that contains the pronunciation of these phrases.

YSKPhraseSpotter provides static methods that allow loading and unloading a model and starting or stopping phrase detection.

Class methods

Method descriptions


+ (NSError *) initializeWithConfigDirectory: (NSString *) configDirectory
andDelegate: (id< YSKPhraseSpotterDelegate >) delegate

Initializes YSKPhraseSpotter.

This method loads the model to memory and sets the delegate.

Loading the model may take some time. The speed depends on the speed and size of the media where the model is located.


Path to the directory containing the model files.


Object that will get messages from YSKPhraseSpotter.


+ (BOOL) isRunning

Returns the state of YSKPhraseSpotter.


+ (NSError *) start

Starts YSKPhraseSpotter.

After this method is called, YSKPhraseSpotter starts recording audio and searching for the specified phrases. Before calling this method, YSKPhraseSpotter must be initialized.


+ (NSError *) stop

Stops YSKPhraseSpotter.

YSKPhraseSpotter stops recording audio, but does not unload the model from memory. The process can be resumed later without reinitializing PhraseSpotter.


+ (NSError *) uninitialize

Deinitializes YSKPhraseSpotter.

Unloads the model from memory and sets the delegate pointer to nil.