简体   繁体   English

[如何]公开发表多篇讲话

[英][how to]openears multiple statement to speech

I'm a newbie to IOs development. 我是IOs开发的新手。 Now, I need use an "Text to speech" functionality in my apps, I found OpenEars platform for do that. 现在,我需要在我的应用程序中使用“文字转语音”功能,我发现OpenEars平台可以做到这一点。 But in my code, it can only speech one statement in one Class. 但是在我的代码中,它只能在一个类中讲一个语句。 I was search on Google but i can't found How to speech multiple statement by using OpenEars. 我在Google上进行搜索,但找不到使用OpenEars如何表达多重陈述的方法。 Here Is my code : 这是我的代码:

- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
[self.oEEO setDelegate:self];
[self.teller say:@"Hello World" withVoice:self.voice];

[self.teller say:@"Hello World Again !" withVoice:self.voice];


return YES;}

oEEO is OpenEarsEventsObserver oEEO是OpenEarsEventsObserver

How to teller say "Hello World Again " ? 柜员怎么说“ Hello World Again”? thank you for reading ! 谢谢您的阅读!

OpenEars developer here. OpenEars开发人员在这里。 FliteController is asynchronous and any new utterance will override the previous one, which means that if you start two utterances almost simultaneously as in your example, you will only hear the second one. FliteController是异步的,任何新的语音都会覆盖前一个语音,这意味着,如果像示例中一样几乎同时启动两个语音,则只会听到第二个语音。 What you want to do is to wait for OpenEarsEventsObserver's fliteDidFinishSpeaking method to know that the first (or the nth) speech utterance is complete so you can begin the next one. 您要做的是等待OpenEarsEventsObserver的fliteDidFinishSpeaking方法知道第一个(或第n个)语音发音已完成,因此您可以开始下一个。 Please bring further questions to the OpenEars forums if you'd like to troubleshoot them with me. 如果您想和我一起解决问题,请向OpenEars论坛提出更多问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM