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でこのようなものを見た人はいますか?