I am trying to use the AVFoundation Text to Speech feature in Swift to speak out a custom String that changes based on a parameter. How can I implement pauses between words?
Let's say this is my String:
var spokenSentence = "I like Toast with lots of Butter, but banana is nice"
How can I make TTS pause for example 3 seconds after "Butter"?
This is my code regarding TTS:
var spokenSentence = "I like Toast with lots of Butter, but banana is nice"
let synth = AVSpeechSynthesizer()
var utterance = AVSpeechUtterance(string: spokenSentence)
and later
synth.speak(utterance)
Outside of swift on MacOS I heard you can use [[slnc 1000]] is there a similar function in Swift?