TextToSpeech tts = TextToSpeech();
String language = 'zh-CN';
tts.setLanguage(language);
but I found it does not work on IOS 17 and IOS 16.
I found the error message in Xcode:
VoiceProvider: Could not start synthesis for request SSML Length: 17, Voice: [AVSpeechSynthesisProviderVoice 0x60000214ada0] Name: Tingting, Identifier: com.apple.voice.super-compact.zh-CN.Tingting, Supported Languages (
"zh-CN"
), Age: 0, Gender: 0, Size: 0, Version: (null), converted from tts request [TTSSpeechRequest 0x60000370f900] 约旦 language: zh-CN footprint: super-compact rate: 0.500000 pitch: 1.000000 volume: 1.000000
Failed to speak request with error: Error Domain=TTSErrorDomain Code=-4010 "(null)". Attempting to speak again with fallback identifier: com.apple.voice.compact.zh-CN.Tingting
Could not instantiate audio unit. Error=Error Domain=NSOSStatusErrorDomain Code=-3000 "(null)"
Could not instantiate audio unit. Error=Error Domain=NSOSStatusErrorDomain Code=-3000 "(null)"
Could not instantiate audio unit. Error=Error Domain=NSOSStatusErrorDomain Code=-3000 "(null)"
My cod:
but I found it does not work on IOS 17 and IOS 16.
I found the error message in Xcode:
It worked before IOS 16.