title: iOS 13 Text To Speech (TTS - AVSpeechSynthesisVoice) crashes for some users after update
body: <p>We are seeing a weird crashes for a small percentage of users related to a problem of TTS after updating to iOS 13. Anybody any idea why this happens? Anybody seeing the same crashes?</p>
  
  <pre><code>let voices = AVSpeechSynthesisVoice.speechVoices()
  
  for voice in voices {
    if voice.name == storedName {
       synthVoice = voice
       break
    }
  }
  
  ...
  
  let utterance  = AVSpeechUtterance(string: text)
  utterance.voice = self.synthVoice
  self.synthesizer.speak(utterance)
  </code></pre>
  
  <p>Crashlog:</p>
  
  <pre><code>Error: Fatal Exception: std::logic_error: Unable to find resource `lang'[kLanguage].
  
  8  libc++abi.dylib                0x19c929304 std::__terminate(void (*)()) + 16
  9  libc++abi.dylib                0x19c928c58 __cxa_get_exception_ptr + 30
  10 libc++abi.dylib                0x19c928c18 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 122
  11 SiriTTS                        0x19f877894 VoiceConfig::report_error(unsigned int, VoiceConfig::IfMissing, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;) + 960
  12 SiriTTS                        0x19f877d88 VoiceConfigImpl::get_json(unsigned int, VoiceConfig::IfMissing) const + 144
  13 SiriTTS                        0x19f8e1210 std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; VoiceConfig::get_param&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt;(unsigned int, VoiceConfig::IfMissing) const + 36
  14 SiriTTS                        0x19f848490 NashvilleAdapterStream::NashvilleAdapterStream(nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;) + 308
  15 SiriTTS                        0x19f8c0158 std::__1::__compressed_pair_elem&lt;NashvilleAdapterStream, 1, false&gt;::__compressed_pair_elem&lt;nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;&amp;, 0ul, 1ul&gt;(std::__1::piecewise_construct_t, std::__1::tuple&lt;nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;&amp;&gt;, std::__1::__tuple_indices&lt;0ul, 1ul&gt;) + 72
  16 SiriTTS                        0x19f8c00d0 std::__1::__shared_ptr_emplace&lt;NashvilleAdapterStream, std::__1::allocator&lt;NashvilleAdapterStream&gt; &gt;::__shared_ptr_emplace&lt;nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;&amp;&gt;(std::__1::allocator&lt;NashvilleAdapterStream&gt;, nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;&amp;&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;&amp;&amp;&amp;) + 40
  17 SiriTTS                        0x19f8c0078 std::__1::shared_ptr&lt;NashvilleAdapterStream&gt; std::__1::shared_ptr&lt;NashvilleAdapterStream&gt;::make_shared&lt;nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;&amp;&gt;(nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;&amp;&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;&amp;&amp;&amp;) + 52
  18 SiriTTS                        0x19f8bffd8 std::__1::shared_ptr&lt;Module&gt; std::__1::__invoke_void_return_wrapper&lt;std::__1::shared_ptr&lt;Module&gt; &gt;::__call&lt;void ModuleFactory::ModuleFactoryImpl::register_module&lt;NashvilleAdapterStream&gt;(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;)::'lambda'(nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;)&amp;, nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt; &gt;(void ModuleFactory::ModuleFactoryImpl::register_module&lt;NashvilleAdapterStream&gt;(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;)::'lambda'(nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;)&amp;&amp;&amp;, nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;&amp;&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;&amp;&amp;) + 48
  19 SiriTTS                        0x19f8bdeb4 ModuleFactory::ModuleFactoryImpl::create(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;) + 164
  20 SiriTTS                        0x19f8bdda4 ModuleFactory::create(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;, std::__1::shared_ptr&lt;SharedObjectPool&gt;) + 60
  21 SiriTTS                        0x19f8652e4 GryphonPipelineFactory::pipeline_from_config(std::__1::shared_ptr&lt;SharedObjectPool&gt;, nlohmann::basic_json&lt;std::__1::map, std::__1::vector, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer&gt; const&amp;) + 472
  22 SiriTTS                        0x19f866a84
  GryphonPipelineFactory::nashvilleFE_backend_pipeline(std::__1::shared_ptr&lt;SharedObjectPool&gt;) + 1140 23 SiriTTS 0x19f85ffb0 FeatureExtractorTarget::init_with_object_pool(std::__1::shared_ptr, bool) + 924
  24 SiriTTS                        0x19f86027c
  FeatureExtractorTarget::init_with_install_path(char const*) + 272
  25 TTSSpeechBundle                0x110480b50 (Missing)
  26 TTSSpeechBundle                0x1104919c4 (Missing)
  27 TTSSpeechBundle                0x110491a6c (Missing)
  28 TTSSpeechBundle                0x11048ef44 (Missing)
  29 TTSSpeechBundle                0x110490514 (Missing)
  30 TTSSpeechBundle                0x11048eefc (Missing)
  31 libsystem_pthread.dylib        0x19c8781f0 _pthread_start + 124
  32 libsystem_pthread.dylib        0x19c87baf0 thread_start + 8
  </code></pre>