Voice Output in iOS

岁酱吖の 提交于 2019-12-01 07:12:01

问题


Is it possible to access the speech synthesis feature of the iOS that is used for accessibility?


回答1:


Here is an example using AVSpeechSynthesizer on iOS 7:

AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc]init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"Hey Guys"];
[synthesizer speakUtterance:utterance];

To change the voice use:

utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"de-DE"];

To get a list of all voices:

NSLog(@"voices %@", [AVSpeechSynthesisVoice speechVoices]);



回答2:


May be you can find this SO question helpful. FLITE also brings speech synthesis to iOS.




回答3:


Now, since ios7 you can use the built in AVSpeechSynthesizer



来源:https://stackoverflow.com/questions/3552250/voice-output-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!