Hey all,
I successfully implemented OpenEars into my project and everything works fine. I just have one trivial thing that I cannot figure out.
How to know which words the user has said? Where is that stored?
This is my code:
self.openEarsEventsObserver = [[OEEventsObserver alloc] init];
[self.openEarsEventsObserver setDelegate:self];
OELanguageModelGenerator *lmGenerator = [[OELanguageModelGenerator alloc] init];
NSArray *words = [NSArray arrayWithObjects:
@”WHAT’S”,
@”WHAT IS”,
@”SHOW ME”,
@”SHOW”,
@”TELL ME”,
@”TELL ME ABOUT”,
@”I’M LOOKING FOR”,
@”WHAT’S COMING”,
@”WHAT’S COMING UP”,
@”HERE”,
@”AT THE NEXT STOP”,
@”AT THE NEXT EXIT”,
@”FOOD”,
@”GAS”,
@”RESTAURANT”,
nil];
NSString *name = @”LanguageModelFiles”;
NSError *err = [lmGenerator generateLanguageModelFromArray:words withFilesNamed:name forAcousticModelAtPath:[OEAcousticModel pathToModel:@”AcousticModelEnglish”]];
if(err == nil) {
_lmPath = [lmGenerator pathToSuccessfullyGeneratedLanguageModelWithRequestedName:name];
_dicPath = [lmGenerator pathToSuccessfullyGeneratedDictionaryWithRequestedName:name];
} else {
NSLog(@”Error: %@”,[err localizedDescription]);
}
– (IBAction)startListening:(UIButton *)sender {
[[OEPocketsphinxController sharedInstance] setActive:TRUE error:nil];
[[OEPocketsphinxController sharedInstance] startListeningWithLanguageModelAtPath:_lmPath dictionaryAtPath:_dicPath acousticModelAtPath:[OEAcousticModel pathToModel:@”AcousticModelEnglish”] languageModelIsJSGF:NO];
}
And I have all the pocketsphinx methods implemented. I just need to do next:
If user said this word, do that.
If user said some other word, do something else.
So where is information about user spoken words stored?
thanks