Synthesizing Speech
Cocoa includes the class NSSpeechSynthesizer; instances of this class produce speech from text.
In MainWindowController.swift, create an instance of NSSpeechSynthesizer.
class MainWindowController: NSWindowController { @IBOutlet weak var textField: NSTextField! @IBOutlet weak var speakButton: NSButton! @IBOutlet weak var stopButton: NSButton! let speechSynth = NSSpeechSynthesizer() override var windowNibName: String { return ...
Get Cocoa Programming for OS X: The Big Nerd Ranch Guide 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.