Reply To: Error when integrating the NeatSpeech demo

Home Forums OpenEars plugins Error when integrating the NeatSpeech demo Reply To: Error when integrating the NeatSpeech demo

#14903
Halle Winkler
Politepix

This would be the lazy instantiation approach:

1. Make sure you’ve imported FliteController+NeatSpeech.h in the VC header after the import of FliteController.h,
2. Create an ivar and property of the voice and of the FliteController in the VC header, synthesize both in the VC implementation, and for each, override their accessor method with the following lazy accessors:

- (Emma *)emma {
	if (emma == nil) {
		emma = [[Emma alloc]initWithPitch:0.0 speed:0.0 transform:0.0];
	}
	return emma;
}

- (FliteController *)fliteController {
	if (fliteController == nil) {
		fliteController = [[FliteController alloc] init];
        
	}
	return fliteController;
}

Then, you don’t initialize either ever, or do any checking of whether they are instantiated, and you don’t have to queue, you just reference them like so:

[self.fliteController sayWithNeatSpeech:@”I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone.” withVoice:self.emma];

Also, just for sanity, double-check that you’ve added the -ObjC other linker flag to the target.