2014-07-12 82 views
-1

我听说AVFoundation框架(不起作用),但有没有办法将文本字段转换为音频文件。如何将文本字段转换为音频文件?

我很想知道它是否有API。

您的帮助,你真的很感激,谢谢。

+0

请参考下面的链接,可能是帮助你http://stackoverflow.com/questions/1102244/iphone- api-for-text-to-speech-feature – users3828291

+0

@SaurabhPrajapati它不会将文本转换为音频文件。 – user3238496

回答

0

使用AVSpeechSynthesizer

AVSpeechUtterance *utterance = [AVSpeechUtterance 
            speechUtteranceWithString:@"Hello world"]; 
    AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init]; 
    [synth speakUtterance:utterance]; 

代替@的 “Hello World” 使用的TextField.text

+0

是的,真的,但我想要一个音频文件,因为我想要通知被发言,所以对于通知声音名称 – user3238496

相关问题