lundi 9 novembre 2015

Voice Recognition (OpenEars) TextView Else If

I have 'Open Ears' integrated into my project. I used lots of the code from they sample project they provide. In the sample project, they provide a textview in the viewcontroller, so when you say a word the word will appear on that text view.

But what i'm trying to do now is, when the user says a certain word (a word that's in the NSArray, that defines each word i have in my language) when it shows up in the text view, it will run some code. Like a 'else if'... But i can't figure out how to do it.

Here is some example code i have, this is when a user types in a certain word into a textfield some code will run.

-(void) perform: (NSString *) command {
    if([command caseInsensitiveCompare:@"ROTATE"] == NSOrderedSame)
    {
        [pattern decreaseAngle];
        int f = [pattern getAngle];
        [self changeAngle:(f)];
    }

Aucun commentaire:

Enregistrer un commentaire