AVSpeechSynthesisVoice crashing in iOS 16 beta

Viewed 102

On iOS 16 beta, the following code is crashing:

AVSpeechSynthesisVoice(language: "en-US")!

with the following error code:

Fatal error: Unexpectedly found nil while unwrapping an Optional value

It worked fine before and I'm not seeing any API change.

Does anyone know what could be going on?

1 Answers

It seems like Apple missed to add voice libraries to iOS 16 betas. Below code returns nil.

AVSpeechSynthesisVoice.speechVoices()

Which should return the list of available voices. I filed a bug, you should also.

Related