Swift3 快速音频讲话-如何在单词之间暂停?

Swift3 快速音频讲话-如何在单词之间暂停?,swift3,avfoundation,Swift3,Avfoundation,我正在使用AVFoundation讲一个或多个单词。我想在这些单词之间引入一个停顿。例如:“让我们跳舞吧” 我使用的代码是: speechString = "Say " + substring[0] utterance = AVSpeechUtterance(string: speechString!) utterance.rate = 0.4 utterance.voice = AVSpeechSynthesisVoice(language: "

我正在使用AVFoundation讲一个或多个单词。我想在这些单词之间引入一个停顿。例如:“让我们跳舞吧”

我使用的代码是:

speechString = "Say " + substring[0]
        utterance = AVSpeechUtterance(string: speechString!)
        utterance.rate = 0.4
        utterance.voice = AVSpeechSynthesisVoice(language: "el-GR")

        synth.pauseSpeaking(at: AVSpeechBoundary.word)
        synth.speak(utterance)
            sleep(2)
        synth.continueSpeaking()
)

我听到了这些话,但没有停顿。感谢您的帮助。

回答我自己的问题,解决方法是插入一两个逗号,如:

speechString = "Say,, " + substring[0]