Reputation: 196
I am making an voice recognition application which recognize my voice in the absence of network for this I am using OpenEars
sdk. I have taken a sample code of it and I have made a similar app of sample code but in my code my openearsEventDelegate
methods are not call.
I have adopt the protocol <openEarsEventObserverDelegate>
and in my viewDidLoad
method I have set openEarseventObserver.delegate=self
.
Please guide me if I am missing something. Thank you.
Upvotes: 0
Views: 219
Reputation: 105
I had the same problem. When I tried to set the delegate before starting listening self.openEarsEventsObserver
was nil
so you can simply check if it's nil before starting listening and then set a new OpenEarsEventsObserver instance to your property. It was a quick fix for me.
Upvotes: 0
Reputation: 772
Without more code it's hard to say exactly what your problem is, but here are a few things I would try:
Ensure your OpenEarsEventObserver object is not nil when you set the delegate:
OpenEarsEventsObserver* openEarsEventsObserver = [[OpenEarsEventsObserver alloc] init];
[openEarsEventsObserver setDelegate:self];
Make sure your pocketsphinxController is not nil and that you have correctly started listening, for this I use lazy instantiation:
- (PocketsphinxController *)pocketsphinxController {
if (_pocketsphinxController == nil) {
_pocketsphinxController = [[PocketsphinxController alloc] init];
}
return _pocketsphinxController;
}
Then when you would like to start recognizing speech use:
[self.pocketsphinxController startListeningWithLanguageModelAtPath:<#(NSString *)#> dictionaryAtPath:<#(NSString *)#> acousticModelAtPath:<#(NSString *)#> languageModelIsJSGF:<#(BOOL)#>];
// Change "AcousticModelEnglish" to "AcousticModelSpanish" to perform Spanish recognition instead of English.
All of this info can be found at: OpenEars Tutorials
Upvotes: 1