I am using below piece of code for TTS in iOS:
let utterance = AVSpeechUtterance(string: "Hello World")
utterance.voice = AVSpeechSynthesisVoice(language: "en-US")
let synthesizer = AVSpeechSynthesizer()
synthesizer.speak(utterance)
It is working fine for iOS 15.6.1 and all lower versions. But the same code is giving below exception in iOS 16 Beta (latest beta 6 as well):
[catalog] Unable to list voice folder
The required voices are present in the iPhone and working properly in Voice Over and Spoken content. Even the voice API AVSpeechSynthesisVoice.speechVoices() is fetching all the voices, but I am getting above exception at line synthesizer.speak(utterance).