내 AVSpeechSynthesizer 코드가 장치 (iOS 10)에서 작동하지 않지만 iOS 9.x에서 작동하며 시뮬레이터에서 작동합니다.iOS10에서 AVSpeechSynthesizer가 작동하지 않습니다.
이Unable to copy asset information from https://mesu.apple.com/assets/ for asset type
사람이이 문제를 해결하는 방법을 알고 있나요 : 같은 오류 메시지가 있었다 그 전에
MobileAssetError:1] Unable to copy asset attributes
Could not get attribute 'LocalURL': Error Domain=MobileAssetError Code=1 "Unable to copy asset attributes"
UserInfo={NSDescription=Unable to copy asset attributes}
0x1741495e0 Copy assets attributes reply: XPC_TYPE_DICTIONARY <dictionary: 0x1741495e0> { count = 1, transaction: 0, voucher = 0x0, contents =
"Result" => <int64: 0x1744203a0>: 1}
:
let str = self.audioOutput //just some string here, this string exists, and it's in english
let synth = AVSpeechSynthesizer()
let utterance = AVSpeechUtterance(string: str)
utterance.rate = AVSpeechUtteranceDefaultSpeechRate
let lang = "en-US"
utterance.voice = AVSpeechSynthesisVoice(language: lang)
synth.speakUtterance(utterance)
이 오류를 받고 있어요? 몇 가지 해결 방법이 있다는 것을 알고 있습니다 (예를 들어 사용자는 설정 -> 일반으로 이동하여 선택 선택으로 전환해야합니다). 그러나 실제 해결책이라고는 생각하지 않습니다.
업데이트 : 새 프로젝트 (XCode8/Swift3/다른 포드/프레임 워크 없음)를 만들었습니다. 그것은 시뮬레이터에서 작동하지만 내 장치에서 동일한 오류를 제공합니다.
업데이트 2 : 기기에서 작동합니다. 비슷한 오류 메시지가 있습니다 (자산 속성 등을 복사 할 수 없습니다). 그러나 지금은 작동합니다. 나는 그것이 무엇인지 모른다.
이'AVSpeechSynthesisVoice (언어 : LANG) 있는지 확인하려고 :) ( 는 목소리 =의 AVSpeechSynthesisVoice.speechVoices하자 을'존재하지 않을 경우 ... 내가 그런 일을 시도 다른 언어 – TonyMkenu
시도 목소리로 목소리로 { print ("\ (voice.언어) ") 인쇄 ("\ (voice.name) ") 인쇄 ("\ (voice.identifier) ") } 내가이? 충분히입니다"이 목록에 EN-US ". – lithium
이 시도 : 다른 {반환}'대신'AVSpeechSynthesisVoice (언어 : LANG).' – TonyMkenu