AVSpeechSynthesizer continues to play even after playback stops and the app crashes (iOS 16+)

Currently, there is an issue that only occurs on iOS 16 devices.

We provide TTS function to pronounce Text using AVSpeechSynthesizer.

When I stop AVSpeechSynthesizer, sometimes the sentence is played without stopping.

After that, if we put nil or declare a new AVSpeechSynthesizer object like the code below

"self.synthesizer = nil or self.synthesizer = AVSpeechSynthesizer()"

The app crashes.

This issue was previously posted on the forum

https://developer.apple.com/forums/thread/716963

It's like this problem. (It is believed to be the cause of this problem.)

This phenomenon occurs randomly when playing, stopping, and repeating a sentence. So it is not easy to reproduce.

We're getting crash reports from our app, but it's only happening on iOS 16 devices.

Does anyone have a cause or solution for this symptom?

I've been looking for a solution for a few weeks now and haven't been able to find a suitable solution. We believe this may be a bug in iOS 16.

I am currently testing on the latest version of iOS 16.0.3. It still happens occasionally.

If we can reproduce this phenomenon with 100% probability, we will give feedback to Apple, but we have to repeat it several times, so we do not think about feedback.

and additionally

Even when leaving the current screen, the app dies after this happens.

If we nil or not initialize the AVSpeechSynthesizer object after stopping the TTS loop in our app,

"self.synthesizer!.speak(utterance)"

As in the code above, there is a phenomenon that playback does not play even if you try to play it.

AVSpeechSynthesizer continues to play even after playback stops and the app crashes (iOS 16+)
 
 
Q