我AVSpeechSynthesizer
在单例中使用。在iOS 8中,当应用程序在后台运行一段时间后,当它恢复时,AVSpeechSynthesizer
单例将不再说话。这个问题在iOS 7上不会发生。
当应用程序进入后台时,我的日志中会显示以下消息:
AVSpeechSynthesizer Audio interruption notification: {
AVAudioSessionInterruptionTypeKey = 1;
}
我在单例的方法中初始化AVSpeechSynthesizer
这样的:init
self.speechSynthesizer = [[AVSpeechSynthesizer alloc] init];
self.speechSynthesizer.delegate = self;
我utterance
这样说:
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上看到过类似的东西?