I am trying to learn how to do text-to-speech for OSX ( not iOS) in Swift. I have a playground with the code:
import Cocoa
let synth = NSSpeechSynthesizer()
synth.startSpeaking( "Hello World" )
It seems to work, but no sound comes up. In Xcode, in the lower left corner there is a small blue triangle that I click, thinking that it can do something, but unfortunately not:

Any ideas how to convert text to speech for OSX on the Swift playground? Thanks in advance!
source
share