iOS 中的语音输出

2023-12-11

是否可以访问用于辅助功能的 iOS 语音合成功能?


这是一个使用的示例AVSpeechSynthesizer在 iOS 7 上:

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

要更改语音,请使用:

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

要获取所有声音的列表:

NSLog(@"voices %@", [AVSpeechSynthesisVoice speechVoices]);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

iOS 中的语音输出 的相关文章

随机推荐