0

I am designing a new iPhone/iPad app and I would include some voice recognition features, using OpenEars and I am new to OpenEars.

The app should recognize some words (commands) from a custom dynamic dictionary, I mean that depending from the user actions, it should be able to recognize some new words and ignore others.

Roughly speaking I need to add and remove words from the dictionary.

Is the call

[languageModelGenerator generateLanguageModelFromArray:]

with a new array of words the right approach ?

Since generateLanguageModelFromArray creates some files, I think that it could impact the app performances, any experience about that ?

Fab
  • 1,468
  • 1
  • 16
  • 37

1 Answers1

1

You can see more details about LanguageModelGenerator and post your issues in politepix.com/openears/

However I'm going to answer.

Yes. You are right.

From their website info,In the method where you want to create your language model , add the following method call

It will generate new language model files in your document Directory (it will overwrite the old files)

NSArray *words = [NSArray arrayWithObjects:@"YOUR FIRST SENTENCE", @"YOUR SECOND SENTENCE", @"YOUR THIRD SENTENCE", nil];

NSString *name = @"NameIWantForMyLanguageModelFiles";
NSError *err = [lmGenerator generateLanguageModelFromArray:words withFilesNamed:name];


NSDictionary *languageGeneratorResults = nil;

NSString *lmPath = nil;
NSString *dicPath = nil;

if([err code] == noErr) {

    languageGeneratorResults = [err userInfo];

    lmPath = [languageGeneratorResults objectForKey:@"LMPath"];
    dicPath = [languageGeneratorResults objectForKey:@"DictionaryPath"];

} else {
    NSLog(@"Error: %@",[err localizedDescription]);
} 
Shamsudheen TK
  • 30,739
  • 9
  • 69
  • 102