AVSpeechSynthesizer not working on iOS 16 Device

When preparing my Lexical App for a new release for iOS 16, I have encountered problems with AVSpeechSynthesizer on a real device (iPhone.)

Here is a simple app that runs into the same problems.

import UIKit
import AVFoundation

class ViewController: UIViewController {
    var speechSynthesizer = AVSpeechSynthesizer ()

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        speakText ("Do any additional setup after loading the view.")
    }


    func speakText (_ text:String) {
        speechSynthesizer = AVSpeechSynthesizer ()
        let utterance = AVSpeechUtterance (string:text)
        speechSynthesizer.speak (utterance)
    }
}

The above code produces the expected result on the iOS simulator, but it produces the following errors on a real device (iPhone 14.)

 2023-09-13 22:23:49.164601+0930 SpeechSynthesizer[760:20606] [catalog] Query for com.apple.MobileAsset.VoiceServicesVocalizerVoice failed: 2
 2023-09-13 22:23:49.164810+0930 SpeechSynthesizer[760:20606] [catalog] Unable to list voice folder
 2023-09-13 22:23:49.176170+0930 SpeechSynthesizer[760:20606] [catalog] Query for com.apple.MobileAsset.VoiceServices.GryphonVoice failed: 2
 2023-09-13 22:23:49.176213+0930 SpeechSynthesizer[760:20606] [catalog] Unable to list voice folder
 2023-09-13 22:23:49.179721+0930 SpeechSynthesizer[760:20606] [catalog] Unable to list voice folder
 2023-09-13 22:23:49.183614+0930 SpeechSynthesizer[760:20612] [catalog] Query for com.apple.MobileAsset.VoiceServices.VoiceResources failed: 2
 2023-09-13 22:23:49.186665+0930 SpeechSynthesizer[760:20606] [catalog] Query for com.apple.MobileAsset.VoiceServices.GryphonVoice failed: 2
 2023-09-13 22:23:49.186705+0930 SpeechSynthesizer[760:20606] [catalog] Unable to list voice folder

Development Environment

  • Mac mini (2018) Intel Core i7

  • macOS Ventura 13.3.1

  • Xcode Version 14.3

Is the AVFoundation framework broken, or I need to change some settings when building the app.

Any help with this is much appreciated.

Same here

AVSpeechSynthesizer not working on iOS 16 Device
 
 
Q