in Lex-Sample/Swift/LexSwift/VoiceChatViewController.swift [32:47]
func voiceButton(_ button: AWSLexVoiceButton, on response: AWSLexVoiceButtonResponse) {
DispatchQueue.main.async(execute: {
// `inputTranscript` is the transcript of the voice input to the operation
if let inputTranscript = response.inputTranscript {
print("Input Transcript: " + inputTranscript)
self.input.text = "\"\(inputTranscript)\""
}
if let outputText = response.outputText {
print("Output Transcript: " + outputText)
self.output.text = outputText
} else {
self.output.text = ""
}
})
}