gpt4 book ai didi

ios - AVSpeechUtterance en-US 语音在 iOS 12 上听起来乱码

转载 作者:行者123 更新时间:2023-11-29 11:31:56 26 4
gpt4 key购买 nike

我有一个使用 AVSpeechUtterance 的应用程序,它在 iOS 12 之前一直运行良好。它仍然可以运行,但 en-US 语音听起来很乱码。这不会发生在 xcode 模拟器或新的 iPhone XS Max 上。它似乎只发生在 iPhone X 上。删除并重新安装应用程序并不能解决问题。唯一的解决方法是将语音更改为 en-IE。有没有其他人遇到过这种情况或找到了解决方法??

AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:@"This is a test"];
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
utterance.rate = AVSpeechUtteranceDefaultSpeechRate;
[self.synthesizer speakUtterance:utterance];

最佳答案

iOS12 使“en-US”使用 Fred 而不是 Samantha

尝试替换:

utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];

与:

utterance.voice = [AVSpeechSynthesisVoice voiceWithIdentifier:@"com.apple.ttsbundle.Samantha-compact"];

关于ios - AVSpeechUtterance en-US 语音在 iOS 12 上听起来乱码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52693071/

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