iOS-使用 Nuance Speechkit,错误 : Ambiguous use of recognize(withType:detection:language:delegate:)

标签 ios swift speech-recognition

我正在尝试使用 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/

相关文章:

ios - 如何在swift中自动重复功能

ios - 在 UIView 数组中查找边

ios - 如何在 SwiftUI 中设置 NavigationView 背景颜色

iOS 从用户文档 Firebase Firestore 存储/更新和检索位置数据

windows - 如何使用GetStorageFileName函数将训练文件添加到注册表?

ios - 即使在 player.status == .readyToPlay 之后,AVPlayerItem.duration 仍返回 NaN

ios - 如何更改 iOS 13 导航栏中的后退按钮图像?

iphone - Swift 根据屏幕尺寸为元素赋予高度

JavaScript Web 语音 API : How can I need the value?

java - 使用 cmu sphinx 进行语音识别 - 无法正常工作