Recognizing speech

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:

  1. 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 
  1. Link IBOutlet and IBAction to the button in the ViewController.Swift file:
      @IBOutlet weak var recordButton: UIButton! 
 
      @IBAction func didClickOnRecordButton(_ sender: AnyObject) { 
      } 
  1. Now, let's add a UITextView above ...

Get iOS Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.