Reply To: [Resolved] Error in implementing RuleORama

Home Forums OpenEars plugins [Resolved] Error in implementing RuleORama Reply To: [Resolved] Error in implementing RuleORama

#1022515
djfink
Participant

Hello!

I am having the exact same problem when combining RapidEars with Rule-O-Rama. I’ve implemented the demo pretty much verbatim, here’s my viewDidLoad method:

###########################################################################

[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

[OpenEarsLogging startOpenEarsLogging];

self.lmGenerator = [[LanguageModelGenerator alloc] init];

NSString *name = @”NameIWantForMyLanguageModelFiles”;

NSDictionary *grammar = @{
ThisWillBeSaidOnce : @[
@{ OneOfTheseCanBeSaidOnce : @[@”HELLO COMPUTER”, @”GREETINGS ROBOT”]},
@{ OneOfTheseWillBeSaidOnce : @[@”DO THE FOLLOWING”, @”INSTRUCTION”]},
@{ OneOfTheseWillBeSaidOnce : @[@”GO”, @”MOVE”]},
@{ThisWillBeSaidOnce : @[
@{ OneOfTheseWillBeSaidOnce : @[@”10″, @”20″,@”30″]},
@{ OneOfTheseWillBeSaidOnce : @[@”LEFT”, @”RIGHT”, @”FORWARD”]}
]},
@{ ThisCanBeSaidOnce : @[@”THANK YOU”]}
]
};

NSError *err = [self.lmGenerator generateFastGrammarFromDictionary:grammar withFilesNamed:name forAcousticModelAtPath:[AcousticModel pathToModel:@”AcousticModelEnglish”]];

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]);
}

self.openEarsEventObserver = [[OpenEarsEventsObserver alloc] init];
[self.openEarsEventObserver setDelegate:self];

self.pocketsphinxController = [[PocketsphinxController alloc] init];

[self.pocketsphinxController setRapidEarsToVerbose:FALSE];
[self.pocketsphinxController setRapidEarsAccuracy:10];
[self.pocketsphinxController setFinalizeHypothesis:TRUE];
[self.pocketsphinxController setFasterPartials:TRUE];
[self.pocketsphinxController setFasterFinals:FALSE];

[self.pocketsphinxController setVerbosePocketSphinx:TRUE];

[self.pocketsphinxController startRealtimeListeningWithLanguageModelAtPath:lmPath dictionaryAtPath:dicPath acousticModelAtPath:[AcousticModel pathToModel:@”AcousticModelEnglish”]];

###########################################################################

And here is the output with OpenEarsLogging and pocketsphinxControllerVerbose both on:

###########################################################################

2014-09-13 16:03:22.826 OpenEarsTest[1248:60b] Starting OpenEars logging for OpenEars version 1.7 on 32-bit device: iPhone running iOS version: 7.100000
2014-09-13 16:03:22.981 OpenEarsTest[1248:60b] The word 10 was not found in the dictionary /var/mobile/Applications/93425C65-62E1-4DA3-B72A-CB896693720E/OpenEarsTest.app/AcousticModelEnglish.bundle/LanguageModelGeneratorLookupList.text/LanguageModelGeneratorLookupList.text.
2014-09-13 16:03:22.982 OpenEarsTest[1248:60b] Now using the fallback method to look up the word 10
2014-09-13 16:03:22.983 OpenEarsTest[1248:60b] If this is happening more frequently than you would expect, the most likely cause for it is since you are using the English phonetic lookup dictionary is that your words are not in English or aren’t dictionary words, or that you are submitting the words in lowercase when they need to be entirely written in uppercase.
2014-09-13 16:03:22.989 OpenEarsTest[1248:60b] Using convertGraphemes for the word or phrase 10 which doesn’t appear in the dictionary
2014-09-13 16:03:23.094 OpenEarsTest[1248:60b] The word 20 was not found in the dictionary /var/mobile/Applications/93425C65-62E1-4DA3-B72A-CB896693720E/OpenEarsTest.app/AcousticModelEnglish.bundle/LanguageModelGeneratorLookupList.text/LanguageModelGeneratorLookupList.text.
2014-09-13 16:03:23.095 OpenEarsTest[1248:60b] Now using the fallback method to look up the word 20
2014-09-13 16:03:23.096 OpenEarsTest[1248:60b] If this is happening more frequently than you would expect, the most likely cause for it is since you are using the English phonetic lookup dictionary is that your words are not in English or aren’t dictionary words, or that you are submitting the words in lowercase when they need to be entirely written in uppercase.
2014-09-13 16:03:23.098 OpenEarsTest[1248:60b] Using convertGraphemes for the word or phrase 20 which doesn’t appear in the dictionary
2014-09-13 16:03:23.192 OpenEarsTest[1248:60b] The word 30 was not found in the dictionary /var/mobile/Applications/93425C65-62E1-4DA3-B72A-CB896693720E/OpenEarsTest.app/AcousticModelEnglish.bundle/LanguageModelGeneratorLookupList.text/LanguageModelGeneratorLookupList.text.
2014-09-13 16:03:23.194 OpenEarsTest[1248:60b] Now using the fallback method to look up the word 30
2014-09-13 16:03:23.195 OpenEarsTest[1248:60b] If this is happening more frequently than you would expect, the most likely cause for it is since you are using the English phonetic lookup dictionary is that your words are not in English or aren’t dictionary words, or that you are submitting the words in lowercase when they need to be entirely written in uppercase.
2014-09-13 16:03:23.196 OpenEarsTest[1248:60b] Using convertGraphemes for the word or phrase 30 which doesn’t appear in the dictionary
2014-09-13 16:03:23.290 OpenEarsTest[1248:60b] I’m done running performDictionaryLookup and it took 0.388514 seconds
2014-09-13 16:03:23.527 OpenEarsTest[1248:60b] Starting dynamic language model generation
2014-09-13 16:03:23.533 OpenEarsTest[1248:60b] Able to open /var/mobile/Applications/93425C65-62E1-4DA3-B72A-CB896693720E/Library/Caches/NameIWantForMyLanguageModelFiles.corpus for reading
2014-09-13 16:03:23.535 OpenEarsTest[1248:60b] Able to open /var/mobile/Applications/93425C65-62E1-4DA3-B72A-CB896693720E/Library/Caches/NameIWantForMyLanguageModelFiles_pipe.txt for writing
2014-09-13 16:03:23.536 OpenEarsTest[1248:60b] Starting text2wfreq_impl
2014-09-13 16:03:23.554 OpenEarsTest[1248:60b] Done with text2wfreq_impl
2014-09-13 16:03:23.556 OpenEarsTest[1248:60b] Able to open /var/mobile/Applications/93425C65-62E1-4DA3-B72A-CB896693720E/Library/Caches/NameIWantForMyLanguageModelFiles_pipe.txt for reading.
2014-09-13 16:03:23.558 OpenEarsTest[1248:60b] Able to open /var/mobile/Applications/93425C65-62E1-4DA3-B72A-CB896693720E/Library/Caches/NameIWantForMyLanguageModelFiles.vocab for reading.
2014-09-13 16:03:23.559 OpenEarsTest[1248:60b] Starting wfreq2vocab
2014-09-13 16:03:23.563 OpenEarsTest[1248:60b] Done with wfreq2vocab
2014-09-13 16:03:23.565 OpenEarsTest[1248:60b] Starting text2idngram
2014-09-13 16:03:23.585 OpenEarsTest[1248:60b] Done with text2idngram
2014-09-13 16:03:23.592 OpenEarsTest[1248:60b] Starting idngram2lm

2014-09-13 16:03:23.610 OpenEarsTest[1248:60b] Done with idngram2lm
2014-09-13 16:03:23.611 OpenEarsTest[1248:60b] Starting sphinx_lm_convert
2014-09-13 16:03:23.618 OpenEarsTest[1248:60b] Finishing sphinx_lm_convert
2014-09-13 16:03:23.624 OpenEarsTest[1248:60b] Done creating language model with CMUCLMTK in 0.096605 seconds.
2014-09-13 16:03:23.640 OpenEarsTest[1248:60b] Generating fast grammar took 0.784263 seconds
2014-09-13 16:03:23.642 OpenEarsTest[1248:60b] Starting sphinx_lm_convert
2014-09-13 16:03:23.648 OpenEarsTest[1248:60b] Finishing sphinx_lm_convert
2014-09-13 16:03:23.651 OpenEarsTest[1248:60b] Accuracy set to 10.
2014-09-13 16:03:23.661 OpenEarsTest[1248:60b] User gave mic permission for this app.
2014-09-13 16:03:23.663 OpenEarsTest[1248:60b] A sample rate was requested that isn’t one of the two supported values of 16000 or 8000 so we will use the default of 16000.
2014-09-13 16:03:23.664 OpenEarsTest[1248:60b] The audio session has never been initialized so we will do that now.
2014-09-13 16:03:23.665 OpenEarsTest[1248:60b] Checking and resetting all audio session settings.
2014-09-13 16:03:23.666 OpenEarsTest[1248:60b] audioCategory is incorrect, we will change it.
2014-09-13 16:03:23.667 OpenEarsTest[1248:60b] audioCategory is now on the correct setting of kAudioSessionCategory_PlayAndRecord.
2014-09-13 16:03:23.668 OpenEarsTest[1248:60b] bluetoothInput is incorrect, we will change it.
2014-09-13 16:03:23.669 OpenEarsTest[1248:60b] bluetooth input is now on the correct setting of 1.
2014-09-13 16:03:23.671 OpenEarsTest[1248:60b] Output Device: ReceiverAndMicrophone.
2014-09-13 16:03:23.673 OpenEarsTest[1248:60b] categoryDefaultToSpeaker is incorrect, we will change it.
2014-09-13 16:03:23.674 OpenEarsTest[1248:60b] CategoryDefaultToSpeaker is now on the correct setting of 1.
2014-09-13 16:03:23.675 OpenEarsTest[1248:60b] preferredBufferSize is incorrect, we will change it.
2014-09-13 16:03:23.676 OpenEarsTest[1248:60b] PreferredBufferSize is now on the correct setting of 0.128000.
2014-09-13 16:03:23.678 OpenEarsTest[1248:60b] preferredSampleRateCheck is incorrect, we will change it.
2014-09-13 16:03:23.679 OpenEarsTest[1248:60b] preferred hardware sample rate is now on the correct setting of 16000.000000.
2014-09-13 16:03:23.708 OpenEarsTest[1248:60b] AudioSessionManager startAudioSession has reached the end of the initialization.
2014-09-13 16:03:23.709 OpenEarsTest[1248:60b] Exiting startAudioSession.
2014-09-13 16:03:23.713 OpenEarsTest[1248:4507] setSecondsOfSilence value of 0.000000 was too large or too small or was NULL, using default of 0.700000.
2014-09-13 16:03:23.727 OpenEarsTest[1248:4507] Project has these words or phrases in its dictionary:
DO THE FOLLOWING GO 10 FORWARD
DO THE FOLLOWING GO 10 FORWARD(2)
DO THE FOLLOWING GO 10 FORWARD THANK YOU
DO THE FOLLOWING GO 10 FORWARD THANK YOU(2)
DO THE FOLLOWING GO 10 LEFT
DO THE FOLLOWING GO 10 LEFT(2)
DO THE FOLLOWING GO 10 LEFT THANK YOU
DO THE FOLLOWING GO 10 LEFT THANK YOU(2)
DO THE FOLLOWING GO 10 RIGHT
DO THE FOLLOWING GO 10 RIGHT(2)
DO THE FOLLOWING GO 10 RIGHT THANK YOU
DO THE FOLLOWING GO 10 RIGHT THANK YOU(2)
DO THE FOLLOWING GO 20 FORWARD
DO THE FOLLOWING GO 20 FORWARD(2)
DO THE FOLLOWING GO 20 FORWARD THANK YOU
DO THE FOLLOWING GO 20 FORWARD THANK YOU(2)
DO THE FOLLOWING GO 20 LEFT
DO THE FOLLOWING GO 20 LEFT(2)
DO THE FOLLOWING GO 20 LEFT THANK YOU
DO THE FOLLOWING GO 20 LEFT THANK YOU(2)
DO THE FOLLOWING GO 20 RIGHT
DO THE FOLLOWING GO 20 RIGHT(2)
DO THE FOLLOWING GO 20 RIGHT THANK YOU
DO THE FOLLOWING GO 20 RIGHT THANK YOU(2)
DO THE FOLLOWING GO 30 FORWARD
DO THE FOLLOWING GO 30 FORWARD(2)
DO THE FOLLOWING GO 30 FORWARD THANK YOU
DO THE FOLLOWING GO 30 FORWARD THANK YOU(2)
DO THE FOLLOWING GO 30 LEFT
DO THE FOLLOWING GO 30 LEFT(2)
DO THE FOLLOWING GO 30 LEFT THANK YOU
…and 510 more.
2014-09-13 16:03:23.730 OpenEarsTest[1248:4507] Recognition loop has started
2014-09-13 16:03:23.742 OpenEarsTest[1248:3a03] Audio route has changed for the following reason:
2014-09-13 16:03:23.749 OpenEarsTest[1248:3a03] There has been a change of category
2014-09-13 16:03:23.781 OpenEarsTest[1248:3a03] The previous audio route was Speaker
2014-09-13 16:03:23.788 OpenEarsTest[1248:3a03] This is not a case in which OpenEars performs a route change voluntarily. At the close of this function, the audio route is SpeakerAndMicrophone
OpenEarsTest(1248,0x31a0000) malloc: *** mach_vm_map(size=4190957568) failed (error code=3)
*** error: can’t allocate region
*** set a breakpoint in malloc_error_break to debug
calloc(1047739392,4) failed from_re_demo file_omitted(0)

###########################################################################

Any help would be greatly appreciated. Thanks!