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.

Note.

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

+initializeWithConfigDirectory:andDelegate:

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

Initializes YSKPhraseSpotter.

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

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

Parameters:
configDirectory

Path to the directory containing the model files.

delegate

Object that will get messages from YSKPhraseSpotter.

+isRunning

+ (BOOL) isRunning

Returns the state of YSKPhraseSpotter.

+start

+ (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.

+stop

+ (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.

+uninitialize

+ (NSError *) uninitialize

Deinitializes YSKPhraseSpotter.

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