How to add a long pause for AVSpeechSynthesizer?

I found that -- may add a small pause, for example, a countdown number:

 10--9--8--7--6--5--4--3--2--1-- 

But I do not know how to add a long pause, like 1 second?

Any idea?

+6
source share
2 answers

AVSpeechUtterance has a postUtteranceDelay property that determines the delay. utterance.postUtteranceDelay = 1.0f; // or 1s is equivalent to NSTimeInterval

@property (non-atomic) NSTimeInterval postUtteranceDelay Description The time that the speech synthesizer will wait after the pronunciation is delivered before the next message in the queue is processed.

+1
source

Even easier in Swift 3

 utterance.preUtteranceDelay = 1.0 

or

 utterance.postUtteranceDelay = 1.0 

for one second of delay, assuming that each number is its own statement (as in a loop). You may need to slightly reduce the delay to take into account the actual duration of the conversation for each number.

+1
source

All Articles