在objective-c iPhone中的文本到语音 [英] Text to speech in objective-c iPhone
本文介绍了在objective-c iPhone中的文本到语音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发一个应用程序,我必须将字符串作为音频播放。
I am developing an application in which I have to play string as an audio.
我正在使用 http://translate.google.com/translate_tts?tl=en&q=Hello 用于说出字符串的API,但速度有点慢。
I am using http://translate.google.com/translate_tts?tl=en&q=Hello API to speak the string but it is a little bit slow.
在objective-c中是否有任何库将字符串作为音频Text To Speech播放。
Is there any library in objective-c to play string as an audio "Text To Speech".
推荐答案
查看io7中的AVSpeechUtterance和AVSpeechSynthesizer类。基本上你可以做到以下几点。
Look at the classes AVSpeechUtterance and AVSpeechSynthesizer in io7. Basically you can just do the following.
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:text];
AVSpeechSynthesizer *syn = [[[AVSpeechSynthesizer alloc] init]autorelease];
[syn speakUtterance:utterance];
这篇关于在objective-c iPhone中的文本到语音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文