Reply To: Not able to start speech recognition

Home Forums OpenEars Not able to start speech recognition Reply To: Not able to start speech recognition

#1024474
kunal.shah
Participant

I’ve taken care of the N-best hypothesis stuff. I’m sorry, but I didn’t really get the first part you were talking about. I’ve attached the code of the view controller of my startListeningWithLanguageModelAtPath: method.
Maybe, you could guide here from hereon.

tempDictionary = @{ThisWillBeSaidOnce:@[
@{ OneOfTheseCanBeSaidOnce :@[@”KINDLY”,@”PLEASE”]},
@{ OneOfTheseWillBeSaidOnce:@[@”CALL”,@”BOOK”,@”RESERVE”]},
@{ ThisWillBeSaidOnce:@[@”RESTAURANT”]},
@{ ThisCanBeSaidOnce:@[@”THANK YOU”]}
]
};

NSError *error =[self.languageModelGenerator generateGrammarFromDictionary:tempDictionary withFilesNamed:@”FirstOpenEarsDynamicLanguageModel” forAcousticModelAtPath:[OEAcousticModel pathToModel:@”AcousticModelEnglish”]];

if(error)
{
NSLog(@”Dynamic language generator reported error %@”, [error description]);
}
else
{
self.pathToFirstDynamicallyGeneratedLanguageModel = [self.languageModelGenerator pathToSuccessfullyGeneratedGrammarWithRequestedName:@”FirstOpenEarsDynamicLanguageModel”];
self.pathToFirstDynamicallyGeneratedDictionary = [self.languageModelGenerator pathToSuccessfullyGeneratedGrammarWithRequestedName:@”FirstOpenEarsDynamicLanguageModel”]; //FOEDLM
}

[[OEPocketsphinxController sharedInstance] setActive:TRUE error:nil];
[[OEPocketsphinxController sharedInstance] setReturnNullHypotheses:YES];
[[OEPocketsphinxController sharedInstance] setRemovingNoise:YES];
[[OEPocketsphinxController sharedInstance] setRemovingSilence:YES];
// [[OEPocketsphinxController sharedInstance] setReturnNbest:YES];
[[OEPocketsphinxController sharedInstance] setVerbosePocketSphinx:TRUE];
[[OEPocketsphinxController sharedInstance] setVadThreshold:VAD_THRESHOLD]; //TO filter out noises
//[OEPocketsphinxController sharedInstance].nBestNumber = BEST_N_HYPOTHESIS; //Top ‘N’ recognition choices
[OEPocketsphinxController sharedInstance].secondsOfSilenceToDetect = SECONDS_OF_SILENCE_TO_DETECT; //To begin recognition

[[OEPocketsphinxController sharedInstance] startListeningWithLanguageModelAtPath:self.pathToFirstDynamicallyGeneratedLanguageModel dictionaryAtPath:self.pathToFirstDynamicallyGeneratedDictionary acousticModelAtPath:[OEAcousticModel pathToModel:@”AcousticModelEnglish”] languageModelIsJSGF:TRUE];

}