Forum Replies Created
-
AuthorPosts
-
July 4, 2013 at 9:30 am in reply to: [Resolved] OpenEarsEventsObserver not working properly #1017621phunkytubeParticipant
Will do, thanks!
It seems inconsistent on their website. Although the second most recent blog post has “Pocketsphinx” in the title, it also has “PocketSphinx” in the body. The API docs also have “PocketSphinx” (http://cmusphinx.sourceforge.net/api/pocketsphinx/). :)
July 4, 2013 at 8:49 am in reply to: [Resolved] OpenEarsEventsObserver not working properly #1017619phunkytubeParticipantPerfectly.
No, the delegate methods used in the sample app don’t work correctly in my app – none of the delegate methods are called. I can’t imagine what is wrong with my setup… Do you have any other ideas of where to look?
July 3, 2013 at 10:31 pm in reply to: [Resolved] OpenEarsEventsObserver not working properly #1017613phunkytubeParticipantUnfortunately not. It’s not an issue with my device, either, since the sample app runs correctly. And the ‘private’ instance variables (instead of, say, in the public header interface declaration) aren’t the problem either :(
July 3, 2013 at 10:10 pm in reply to: [Resolved] OpenEarsEventsObserver not working properly #1017609phunkytubeParticipantHi Halle, thanks for the swift reply! My code is the following (with names replaced for simplicity):
// OpenEarsWrapper.h #import <Foundation/Foundation.h> #import <OpenEars/OpenEarsEventsObserver.h> @interface OpenEarsWrapper : NSObject <OpenEarsEventsObserverDelegate> - (id)initAndStartListeningWithWordsArray:(NSArray *)_words filename:(NSString *)_filename; @end // OpenEarsWrapper.m #import "OpenEarsWrapper.h" #import <OpenEars/LanguageModelGenerator.h> #import <OpenEars/PocketsphinxController.h> #import <OpenEars/OpenEarsLogging.h> @interface OpenEarsWrapper () @property (nonatomic, strong) OpenEarsEventsObserver *openEarsEventsObserver; @property (nonatomic, strong) NSString *languageModelPath; @property (nonatomic, strong) NSString *dictionaryPath; @property (nonatomic, strong) PocketsphinxController *pocketSphinxController; // out of curiosity why is the 's' in "sphinx" lowercase??? @end @implementation OpenEarsWrapper @synthesize openEarsEventsObserver; @synthesize languageModelPath, dictionaryPath; @synthesize pocketSphinxController; - (id)initAndStartListeningWithWordsArray:(NSArray *)_words filename:(NSString *)_filename { self = [super init]; if (self) { //[OpenEarsLogging startOpenEarsLogging]; openEarsEventsObserver = [[OpenEarsEventsObserver alloc] init]; [openEarsEventsObserver setDelegate:self]; LanguageModelGenerator *languageModelGenerator = [[LanguageModelGenerator alloc] init]; NSError *error = [languageModelGenerator generateLanguageModelFromArray:_words withFilesNamed:_filename]; NSDictionary *languageGeneratorResults = nil; if ([error code] == noErr) { languageGeneratorResults = [error userInfo]; languageModelPath = [languageGeneratorResults objectForKey:kLanguageModelPathKey]; dictionaryPath = [languageGeneratorResults objectForKey:kDictionaryPathKey]; } else { NSLog(@"Error: %@", [error localizedDescription]); return self; } pocketSphinxController = [[PocketsphinxController alloc] init]; [pocketSphinxController startListeningWithLanguageModelAtPath:languageModelPath dictionaryAtPath:dictionaryPath languageModelIsJSGF:NO]; } return self; } - (void)pocketsphinxDidReceiveHypothesis:(NSString *)hypothesis recognitionScore:(NSString *)recognitionScore utteranceID:(NSString *)utteranceID { NSLog(@"why doesn't this fire!!!!"); } @end
-
AuthorPosts