我正在尝试使用 Nuance Speechkit 并构建一个可以生成语音转录的语音识别应用程序。在 Nuance 中识别语音的方法给出错误:在调用方法时模棱两可地使用 recognize(withType:detection:language:delegate:):
skTransaction = skSession?.recognize(withType: SKTransactionSpeechTypeTV, detection: SKTransactionEndOfSpeechDetection.none, language: LANGUAGE, delegate: self)
我猜我是在 Swift 3 中做的,也许是 Nuance 在使用新语法时遇到了问题,或者 Swift 3 编译器导致了一些内部问题,因为相同的方法在 Swift 2.3 中工作正常。
如果有人对此类错误有任何想法,请提供帮助。
提前致谢。
最佳答案
我遇到了同样的问题,我使用带有空选项参数的替代方法解决了它
let options = [
"" : ""
]
_ = session?.recognize(withType: SKTransactionSpeechTypeDictation, detection: .long, language: "eng-USA", options: options, delegate: self)
关于iOS-使用 Nuance Speechkit,错误 : Ambiguous use of recognize(withType:detection:language:delegate:),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40191090/