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.
Asked
Active
Viewed 685 times
1
Isaac Wasserman
- 1,461
- 4
- 19
- 39
1 Answers
6
Have you looked at the header (or generated Swift interface) for AVSpeechSynthesizer? Or its documentation? Looks pretty straightforward there...
Set an instance of one of your classes as the
delegateof the speech synthesizer.In that class, implement the
speechSynthesizer(_:didFinishSpeechUtterance:)method. It'll be called whenever an utterance finishes speaking.There's no step three.
rickster
- 124,678
- 26
- 272
- 326