gpt4 book ai didi

iphone - iOS 中的语音输出

转载 作者:可可西里 更新时间:2023-11-01 17:12:09 24 4
gpt4 key购买 nike

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

最佳答案

这是一个在 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]);

关于iphone - iOS 中的语音输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3552250/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com