我们的app一直使用苹果自带的语音合成器来合成语音。今天客户报告没有声音了。原来在iOS13这个版本,voice这个属性必须要设置了才行,否则木有声音!!
AVSpeechUtterance *aDirection = [[AVSpeechUtterance alloc] initWithString:"你好"];
aDirection.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"zh-CN"]; //这句话现在必须设置
aDirection.rate = AVSpeechUtteranceDefaultSpeechRate;
aDirection.pitchMultiplier = PitchMultiplier;
[self.synthesizer speakUtterance:aDirection];
网友评论