This code doesn't work. What should I do when it stops prematurely?
import Foundation
import AVFoundation
print("Hello, World!")
var synthesizer = AVSpeechSynthesizer()
let utterance = AVSpeechUtterance(string: "Hello World!")
utterance.voice = AVSpeechSynthesisVoice(identifier: "com.apple.speech.synthesis.voice.samantha.premium")
utterance.rate = 0.5
synthesizer.speak(utterance)
print("Done.")
Topic:
App & System Services
SubTopic:
General
Tags:
Foundation
Swift
Command Line Tools
AVFoundation