objective c - iOS - pause AVSpeech while reading a specific word -
i'm working on app reads text in uitextfield
using avspeech
, i'm trying pause reading when reads specific word, example reading this awesome.
, want pause reading 2 seconds when reads is
, complete reading. here code read string.
avspeechsynthesizer *synth = [[avspeechsynthesizer alloc] init]; avspeechutterance *utterance = [[avspeechutterance alloc] initwithstring:@"this awesome"]; utterance.rate = 0.15; utterance.voice = [avspeechsynthesisvoice voicewithlanguage:@"en-us"]; [synth speakutterance:utterance];
thanks
separate utterance string on occurrences of "is" , put components in array. read each string in array in order sleep(2)
in between. keep in mind sleeping on main thread disable ui interactions.
Comments
Post a Comment