更新后,某些用户的iOS 13文本语音转换(TTS-AVSpeechSynthesisVoice)崩溃 [英] iOS 13 Text To Speech (TTS - AVSpeechSynthesisVoice) crashes for some users after update

查看:152
本文介绍了更新后,某些用户的iOS 13文本语音转换(TTS-AVSpeechSynthesisVoice)崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在更新到iOS 13之后,我们看到一小部分与TTS问题相关的用户崩溃.有人知道为什么会发生这种情况吗?有人看到过相同的崩溃吗?

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?

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)

崩溃日志:

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<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 960
12 SiriTTS                        0x19f877d88 VoiceConfigImpl::get_json(unsigned int, VoiceConfig::IfMissing) const + 144
13 SiriTTS                        0x19f8e1210 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > VoiceConfig::get_param<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(unsigned int, VoiceConfig::IfMissing) const + 36
14 SiriTTS                        0x19f848490 NashvilleAdapterStream::NashvilleAdapterStream(nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, std::__1::shared_ptr<SharedObjectPool>) + 308
15 SiriTTS                        0x19f8c0158 std::__1::__compressed_pair_elem<NashvilleAdapterStream, 1, false>::__compressed_pair_elem<nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, std::__1::shared_ptr<SharedObjectPool>&, 0ul, 1ul>(std::__1::piecewise_construct_t, std::__1::tuple<nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, std::__1::shared_ptr<SharedObjectPool>&>, std::__1::__tuple_indices<0ul, 1ul>) + 72
16 SiriTTS                        0x19f8c00d0 std::__1::__shared_ptr_emplace<NashvilleAdapterStream, std::__1::allocator<NashvilleAdapterStream> >::__shared_ptr_emplace<nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, std::__1::shared_ptr<SharedObjectPool>&>(std::__1::allocator<NashvilleAdapterStream>, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&&&, std::__1::shared_ptr<SharedObjectPool>&&&) + 40
17 SiriTTS                        0x19f8c0078 std::__1::shared_ptr<NashvilleAdapterStream> std::__1::shared_ptr<NashvilleAdapterStream>::make_shared<nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, std::__1::shared_ptr<SharedObjectPool>&>(nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&&&, std::__1::shared_ptr<SharedObjectPool>&&&) + 52
18 SiriTTS                        0x19f8bffd8 std::__1::shared_ptr<Module> std::__1::__invoke_void_return_wrapper<std::__1::shared_ptr<Module> >::__call<void ModuleFactory::ModuleFactoryImpl::register_module<NashvilleAdapterStream>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'(nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, std::__1::shared_ptr<SharedObjectPool>)&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, std::__1::shared_ptr<SharedObjectPool> >(void ModuleFactory::ModuleFactoryImpl::register_module<NashvilleAdapterStream>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'(nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, std::__1::shared_ptr<SharedObjectPool>)&&&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&&&, std::__1::shared_ptr<SharedObjectPool>&&) + 48
19 SiriTTS                        0x19f8bdeb4 ModuleFactory::ModuleFactoryImpl::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, std::__1::shared_ptr<SharedObjectPool>) + 164
20 SiriTTS                        0x19f8bdda4 ModuleFactory::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, std::__1::shared_ptr<SharedObjectPool>) + 60
21 SiriTTS                        0x19f8652e4 GryphonPipelineFactory::pipeline_from_config(std::__1::shared_ptr<SharedObjectPool>, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&) + 472
22 SiriTTS                        0x19f866a84
GryphonPipelineFactory::nashvilleFE_backend_pipeline(std::__1::shared_ptr<SharedObjectPool>) + 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

推荐答案

更新:问题似乎已在iOS 13.2中修复!是的!

UPDATE: Issue appears to be fixed in iOS 13.2! Yay!

看起来像某些运行IOS 13的设备上的错误(在我的情况下为iPhone SE上的13.1.2)

Looks like a bug on some devices running IOS 13 (In my case 13.1.2 on an iPhone SE),

AVSpeechSynthesisVoice.speechVoices()

返回nil.

此外,仅供参考,还可以使用AVSpeechSynthesisVoice初始化程序(如

Also, FYI, setting a voice using the AVSpeechSynthesisVoice initializer such as

AVSpeechSynthesisVoice(language: "fr-FR")

将语音设置为nil,将英语设置为后备/默认值.

results in the voice being set as nil and English being used as a fallback/default.

我已经针对这两个问题提交了反馈...以及以前的

I have filed a feedback on both issues... and also previously this one which was fixed during 13 beta, but now I'm not so sure... since this new issue either supersedes it or is a result of engineers in different departments working at cross-purposes.

这篇关于更新后,某些用户的iOS 13文本语音转换(TTS-AVSpeechSynthesisVoice)崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆