Text to speech conversion

痴心易碎 提交于 2019-12-21 03:01:08

问题


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.


回答1:


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.




回答2:


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:

http://www.politepix.com/openears/yourapp/



来源:https://stackoverflow.com/questions/6225521/text-to-speech-conversion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!