AVSpeechSynthesizer crashes with German voice only

In one of my Apps I'm using AVSpeechSynthesizer let the watch speak text to the user, which works great in general, but not when selecting a German voice (the only one that is available under watchOS 6,1,1 is "Anna-compact"). With the German voice to sperak German text, that App always crashes under watchOS 6.1.1 (it did not crash under watchOS 5, and I think not under early watchOS 6 releases, though I can't really tell when this issue started).


The code which starts the speech output is simple:

  AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:text];
  utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"de"];
  [self.speechSynthesizer speakUtterance:utterance];


The crash happens within the speakUtterance call, the App never returns from this call, also none of the delegeta methods of AVSpeechSynthesizer is ever called here, so the crash occurs while the watchOS initializes its internal data structures.


The watchOS throws this exception:

EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=80 MB, unused=0x0)


and is crashing here (deep within the TTS component of watchOS):

#00x1c4f370c in __CFToUTF8 ()
#10x1c586f48 in __CFStringEncodeByteStream ()
#20x1ceee8a4 in -[NSString(NSStringOtherEncodings) getBytes:maxLength:usedLength:encoding:options:range:remainingRange:] ()
#30x1cffdecc in _NS_os_log_callback ()
#40x1c1e538c in _os_log_fmt_flatten_NSCF ()
#50x1c1e4c10 in _os_log_fmt_flatten_object ()
#60x1c1f1308 in _os_log_impl_flatten_and_send ()
#70x1c1f0bec in _os_log ()
#80x1c1f6b90 in _os_log_debug_impl ()
#90x3fbb466c in -[TTSRegexHelper _addRules:] ()
#100x1bf945a8 in _dispatch_client_callout ()
#110x1bfa0eb8 in _dispatch_lane_barrier_sync_invoke_and_complete ()
#120x3fbb4368 in -[TTSRegexHelper addRules:] ()
#130x04ecb050 in ___lldb_unnamed_symbol8$$TTSSpeechBundle ()
#140x3fbc79ac in -[TTSVocalizer loadResource:mimeType:resourceURL:supportsAccurateWordCallbacks:] ()
#150x3fbc4d4c in -[TTSSpeechServerInstance _loadVoiceResource:voiceResource:] ()
#160x3fbc4960 in -[TTSSpeechServerInstance _initializeSpeechEngine:] ()
#170x3fbc4b7c in -[TTSSpeechServerInstance _initializeSpeech:] ()
#180x3fbc260c in -[TTSSpeechServerInstance _processCurrentRequest:] ()
#190x3fbc3704 in -[TTSSpeechServerInstance _handleSpeechThread] ()
#200x3fbc25c0 in _SpeechThread ()
#210x1c1cc930 in _pthread_start ()



I've no idea if this is a general issue/bug of watchOS 6.1.1 (it comes with damaged/broken voice files for German), or if only something on my watch got damaged for some unknown reason.


Has anyone any experience in using AVSpeechSynthesizer on the AppleWatch and can reproduce this crash when using the German voice? Does it work under watchOS 6.1.1 on other devices?


The text itself which should be read can not be the problem, because it crashes even with the text "1 2 3" (counting to 3), so no special characters (umlaut) or other fancy things involved. As test case "1 2 3" works great because this same text can be used for all languages and voices in the same way.

AVSpeechSynthesizer crashes with German voice only
 
 
Q