我尝试使用如下语音识别
let urlpath = Bundle.main().pathForResource("myvoice2", ofType: "m4a")
let url:URL = URL.init(fileURLWithPath: urlpath!)
let recognizer = SFSpeechRecognizer()
let request = SFSpeechURLRecognitionRequest(url: url)
recognizer?.recognitionTask(with: request, resultHandler: { (result, error) in
print (result?.bestTranscription.formattedString)
})
结果为零,我调试并看到如下错误
Error Domain=kAFAssistantErrorDomain Code=1101 "(null)"
你有什么主意吗?