Does in iOS 7.0 AVSpeechSynthesizer have US male voice?

别来无恙 提交于 2019-12-04 10:55:37

问题


Solution : It doesnot have US male voice


I have used 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
}

I need to use US male voice instead of male UK voice.


回答1:


iOS still doesn't provide US male voice. You can find all BCP-47 code of available voices

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


来源:https://stackoverflow.com/questions/20944611/does-in-ios-7-0-avspeechsynthesizer-have-us-male-voice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!