Does iOS provide built in text to speech support or any class like NSSpeechRecognizer?

Kri*_*hna 18 speech-recognition text-to-speech ios

i have found many libraries like flite which can be be used, as in given here, but I want to know if there is any Built-In class provided by iOS SDK similar to NSSpeechRecognizer provided in OS X.

lxt*_*lxt 45

在iOS 5或6中没有内置的文本到语音支持 - 您需要使用第三方库.如果你使用的是iOS 7,那么你很幸运.

在iOS 7中有一个新类叫AVSpeechSynthesizer(Apple的文档可以在这里找到).您可以使用它来执行文本到语音转换.这是一个简单的例子:

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

[synth speakUtterance:utterance];
Run Code Online (Sandbox Code Playgroud)

速度和语音类型等属性设置在AVSpeechUtterance合成器中,而不是合成器中.

  • 尽管仍然处于测试阶段,iOS 7现在已经公开,并且包含了可用于文本到语音转换的"AVSpeechSynthesizer"类.[参考文献](https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVSpeechSynthesizer_Ref/Reference/Reference.html#//apple_ref/doc/uid/TP40013447). (4认同)