我在单身人士中使用AVSpeechSynthesizer.在iOS 8中,当应用程序被搁置一段时间后,当它恢复AVSpeechSynthesizer时,单例将不再说话. iOS 7上不会发生此问题.
AVSpeechSynthesizer Audio interruption notification: { AVAudioSessionInterruptionTypeKey = 1; }
我在singleton的init方法中初始化了AVSpeechSynthesizer:
self.speechSynthesizer = [[AVSpeechSynthesizer alloc] init]; self.speechSynthesizer.delegate = self;
我说这样的话语:
AVSpeechUtterance *utt = [[AVSpeechUtterance alloc] initWithString:dialogue]; utt.voice = [AVSpeechSynthesisVoice voiceWithLanguage:voice]; utt.pitchMultiplier = pitch; utt.rate = rate; utt.preUtteranceDelay = preDelay; utt.postUtteranceDelay = postDelay; utt.volume = volumeSetting; [self.speechSynthesizer speakUtterance:utt];
iOS 8上有没有人见过这样的东西?