Question: How to stop a sound that has lost control (AVSpeechSynthesizer)

I'm struggling with a recent bug in iOS 16.

There are various errors and bugs Currently struggling with AVSpeechSynthesizer. AutoReleasePool crashes frequently.

I also posted a similar post on the forum before.

https://developer.apple.com/forums/tags/speech

There seems to be a lot of similar cases in the forum posts above.

When AVSpeechSynthesizer is stopped, it does not stop immediately, but continues to play to the end.

In that situation, even if you stop again, you lose control and cannot stop.

Is there any way to stop the currently playing sound at will when I lose control like this?

(I was also able to confirm that the error persisted without being fixed when I tested it on a device that just installed the 16.2 beta.)

When AVSpeechSynthesizer is stopped

How do you stop it ?

Do you keep a reference to the synthesizer ? Do you stop at word, or even immediately ?

        if synthesizer != nil {
            synthesizer!.stopSpeaking(at: .word)
            synthesizer = nil
        }

Hello, please attach a sample project and any relevant crash logs in a bug report using Feedback Assistant, this will help immensely with triaging and debugging the issue you are encountering. https://developer.apple.com/bug-reporting/

If you have done so already, please share the feedback ID number so I can make sure the right folks see your report. Thanks!

Question: How to stop a sound that has lost control (AVSpeechSynthesizer)
 
 
Q