jack87
jack87

Reputation: 465

AVSpeechSynthesis ended

Hi I'm building an iOS 7 app using AVSpeechSynthesizer and AVSpeechUtterance I'm trying to figure out when the synthesis is done. To be more specific I'd love to change the appereance of the play/pause button when the synthesis is over. Someone can help me understand if there is some method called at the end of the synthesis? Thanks in advance

Upvotes: 0

Views: 220

Answers (1)

Michał Ciuba
Michał Ciuba

Reputation: 7944

Set the delegate property of AVSpeechSynthesizer and implement the following delegate method:

- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didFinishSpeechUtterance:(AVSpeechUtterance *)utterance {
    //do whatever you need to do
}

You may also be interested in speechSynthesizer:didCancelSpeechUtterance: delegate method if you stop speaking programatically (for example, after a button is pressed).

Upvotes: 2

Related Questions