Google speech to text integration in swift
Asked Answered
C

1

7

I am developing a application that the voice as input and must give the text as the output and it is an iOS app and previously i developed the app through the Siri kit and implemented it. But problem is that i am not getting correct output as i speak.So, i need to integrate the Google speech instead of the Siri kit. I am not able to find any of the sources to integrate into the swift 4 in my iOS app.

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()

Please help me out, Thanx.

Cowpox answered 20/8, 2018 at 9:42 Comment(0)
P
-2

Your code is nowhere near to google speech to text integration. It Speech recogniser class. If you need to integrate Google speech recogniser, go through this tutorial which explains how to integrate google speech to text in iOS swift and also how to train the google speech cloud using the metadata.

Perilymph answered 15/8, 2020 at 19:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.