-
-
Save anupamchugh/af1ba853eddf057c5dfe8a6b06c783c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
recognitionTask = speechRecognizer?.recognitionTask(with: recognitionRequest) { result, error in | |
if let result = result { | |
DispatchQueue.main.async { | |
let transcribedString = result.bestTranscription.formattedString | |
self.transcribedText.text = (transcribedString) | |
} | |
} | |
if error != nil { | |
self.audioEngine.stop() | |
inputNode.removeTap(onBus: 0) | |
self.recognitionRequest = nil | |
self.recognitionTask = nil | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment