Render the text       This is an example of speech synthesis      as speech.



Related task

   using a speech engine to highlight words




import Foundation
 
let task = NSTask()
task.launchPath = "/usr/bin/say"
task.arguments = ["This is an example of speech synthesis."]
task.launch()