在iOS 7.0 AVSpeechSynthesizer有美国男声吗?
解决scheme :没有US male voice
我已经使用iOS7.0
framework
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
。
iOS仍然不提供美国男性的声音。 你可以find所有可用语音的BCP-47代码
for (AVSpeechSynthesisVoice *voice in [AVSpeechSynthesisVoice speechVoices]) { NSLog(@"%@", voice.language); }