The framework communicates with Apple's servers or tries to use an on-device recognizer if available. We will build a demo to see how to use the framework to recognize speech.
We will use the same project to add the feature of recognizing speech:
- Open the storyboard and, at the bottom, let's add a button with the title Start Recording with the following constraints:
Record.height = 49 Record.leading = Superview.leading + 16 Record.trailing = Superview.trailing - 16 Record.bottom = Superview.bottom - 8
- Link IBOutlet and IBAction to the button in the ViewController.Swift file:
@IBOutlet weak var recordButton: UIButton! @IBAction func didClickOnRecordButton(_ sender: AnyObject) { }
- Now, let's add a UITextView above ...