小编Him*_*imz的帖子

AVSpeechSynthesizer的话语率在iOS7和iOS 9中有所不同

问题:在iOS 7.x和iOS 8.x中,此代码运行正常,但在iOS 9.x中,与iOS 7和8中的语音速率相比,语音速度变慢.

self.synthesizer = [[AVSpeechSynthesizer alloc] init];

self.synthesizer.delegate = self;

AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:[NSString stringWithFormat:@"Hey %@, please choose places to explore or select excursions to see our custom crafted deals",[defaults objectForKey:@"USERNAME"]]];

utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];

utterance.rate = 0.10;

[self.synthesizer speakUtterance:utterance]; 
Run Code Online (Sandbox Code Playgroud)

objective-c text-to-speech avspeechsynthesizer ios9 xcode7

6
推荐指数
1
解决办法
1499
查看次数