AVSpeechSynthesizer的话语率在iOS7& iOS 9

时间:2015-09-29 18:20:30

标签: objective-c text-to-speech ios9 xcode7 avspeechsynthesizer

问题:在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]; 

1 个答案:

答案 0 :(得分:3)

[utterance setRate: 0.5f];将完成这项工作