iOS中的语音输出

是否有可能访问用于可访问性的iOS语音合成function?

以下是在iOS 7上使用AVSpeechSynthesizer的示例:

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

要改变语音使用:

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

要获得所有声音的列表:

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

也许你可以find这个问题有帮助。 FLITE也为iOS带来语音合成。

现在,由于ios7,您可以使用内置的AVSpeechSynthesizer