Post

Replies

Boosts

Views

Activity

How do you run AVSpeechSynthesizer from command-line Swift on MacOS?
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.")
1
0
2k
Jan ’21