Text to speech conversion

谁都会走 提交于 2019-12-03 09:11:36

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:

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

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