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