11

解决方案:没有US male voice


AVSpeechSynthesizer framework用过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
}

我需要使用US male voice而不是male UK voice.

4

1 回答 1

2

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

for (AVSpeechSynthesisVoice *voice in [AVSpeechSynthesisVoice speechVoices]) {
NSLog(@"%@", voice.language);
}
于 2015-01-30T12:55:03.353 回答