1

How do I set a completion event on the SpeakUtterance(utterance) function in Swift? I need this so that my speech is neither interrupted nor interrupting.

Isaac Wasserman
  • 1,461
  • 4
  • 19
  • 39

1 Answers1

6

Have you looked at the header (or generated Swift interface) for AVSpeechSynthesizer? Or its documentation? Looks pretty straightforward there...

  1. Set an instance of one of your classes as the delegate of the speech synthesizer.

  2. In that class, implement the speechSynthesizer(_:didFinishSpeechUtterance:) method. It'll be called whenever an utterance finishes speaking.

  3. There's no step three.

rickster
  • 124,678
  • 26
  • 272
  • 326