gpt4 book ai didi

ios - iOS 7.0 中的 AVSpeechSynthesizer 有美国男声吗?

转载 作者:技术小花猫 更新时间:2023-10-29 10:53:09 29 4
gpt4 key购买 nike

解决方案:它没有美国男声


我使用AVSpeechSynthesizer framework for iOS7.0

AVSpeechUtterance *utt = [AVSpeechUtterance speechUtteranceWithString:@"Hello"]; 
if (isMale) //flag for male or female voice selected
{
// need US male voice as en-US is providing only US female voice
utt.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-GB"]; //UK male voice
}
else
{
utt.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"]; //US female voice
}

我需要使用美国男声而不是英国男声

最佳答案

iOS 仍然不提供美国男声。您可以找到所有可用语音的BCP-47代码

for (AVSpeechSynthesisVoice *voice in [AVSpeechSynthesisVoice speechVoices]) {
NSLog(@"%@", voice.language);
}

关于ios - iOS 7.0 中的 AVSpeechSynthesizer 有美国男声吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20944611/

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