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合成器中,而不是合成器中.