Par*_*iya 11 iphone objective-c ios ios7 avspeechsynthesizer
解决方案:它没有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
}
Run Code Online (Sandbox Code Playgroud)
我需要用US male voice而不是male UK voice.
iOS 仍然不提供美国男声。您可以找到所有可用语音的 BCP-47 代码
for (AVSpeechSynthesisVoice *voice in [AVSpeechSynthesisVoice speechVoices]) {
NSLog(@"%@", voice.language);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4475 次 |
| 最近记录: |