【问题标题】:Google speech to text integration in swift谷歌语音到文本的快速集成
【发布时间】:2018-08-20 09:42:56
【问题描述】:

我正在开发一个应用程序,它将语音作为输入并且必须将文本作为输出,它是一个 iOS 应用程序,之前我通过 Siri 工具包开发了该应用程序并实现了它。 但问题是我说话时没有得到正确的输出。所以,我需要集成 Google 语音而不是 Siri 套件。我无法在我的 iOS 应用中找到任何可集成到 swift 4 的资源。

SFSpeechRecognizer.requestAuthorization { (authStatus) in
            var isButtonEnabled = false
            switch authStatus {
            case .authorized:
                isButtonEnabled = true
            case .denied:
                isButtonEnabled = false
                print("User denied access to speech recognition")
            case .restricted:
                isButtonEnabled = false
                print("Speech recognition restricted on this device")
            case .notDetermined:
                isButtonEnabled = false
                print("Speech recognition not yet authorized")
            }
            OperationQueue.main.addOperation() {
                // self.microphoneButton.isEnabled = isButtonEnabled
            }
  private let speechRecognizer = SFSpeechRecognizer(locale: Locale.init(identifier: "en-US"))!
    private var recognitionRequest: SFSpeechAudioBufferRecognitionRequest?
    private var recognitionTask: SFSpeechRecognitionTask?
    private let audioEngine = AVAudioEngine()

请帮帮我, 谢谢。

【问题讨论】:

    标签: swift speech-to-text google-speech-api


    【解决方案1】:

    您的代码远不及谷歌语音到文本的集成。它语音识别器类。如果您需要集成 Google 语音识别器,请阅读本教程,该教程解释了如何在 iOS swift 中将 google 语音集成到文本,以及如何使用元数据训练 google 语音云。

    【讨论】:

      猜你喜欢
      • 2017-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-16
      • 2011-05-01
      • 2011-10-05
      • 1970-01-01
      相关资源
      最近更新 更多