IPhone : AVSpeechSynthesizer speaks, when runs again, takes 10 or so seconds before start

on Sunday, April 19, 2015

When I run this code, it runs fine, but when I run it again, it takes about 10 or so seconds before it runs and that too also gets cut off sometimes.



NSString *string = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:string];
utterance.rate = 0.1000;
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"hi-IN"];

AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init];
[synthesizer speakUtterance:utterance];
//[synthesizer pauseSpeakingAtBoundary:AVSpeechBoundaryWord];

0 comments:

Post a Comment