I am using OpenEars in my app for speech to text conversion, but now the situation demands that I convert my text to speech. Can I do this using OpenEars only? Has anyone tried this?
If so, please guide me on how to do this. Any help will be appreciated.
Yes it is possible through open ears. You can look at the sample project provided in the Openears itself with the help of FliteController.
There is method called say.
e.g.
-(void)viewDidLoad {
[super viewDidLoad];
// This is how to use an available instance of FliteController.
[fliteController say:@"Welcome to OpenEars."];
}
Hope it helps.
In a class in which you want to use FliteController you need to import FliteController.h:
#import "FliteController.h"
Next, you need to open OpenEarsVoiceConfig.h in a correctly-configured installation and uncomment the voices you need to use, as explained in that file.
Then you can instantiate FliteController and send it the following message using a voice you've uncommented:
[self.fliteController say:@"A phrase I'd like my app to speak out loud." withVoice:@"cmu_us_awb8k"];
That should be sufficient if you're clear on how to instantiate the object and your installation of OpenEars is correct. If not, there is even more detail on the specifics at the following URL:
来源:https://stackoverflow.com/questions/6225521/text-to-speech-conversion