Nsstring *text =@"Long test with dot. I want speaching pause when read dot. How can I do?";AVSpeechSynthesizer *synthesizer = [AVSpeechSynthesizer new];[synthesizer setDelegate:self];AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:text]; utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:[self.defaults objectForKey:LANGUAGE]]; utterance.rate = 0.28; [synthesizer speakUtterance:utterance];
可能吗?我能怎么做 ??
解决方法 我的意思是一个点(.)但也许我找到了一个解决方案也是字符”,’:
Nsstring *text = @"line one. lineTwo aftre a pause. line three,pause here again."; text = [text stringByReplacingOccurrencesOfString:@"," withString:@"."]; NSArray *a = [text componentsSeparatedByString:@"."]; for(Nsstring *line in a) { AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:line]; utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:[self.defaults objectForKey:liNGUA]]; utterance.rate = 0.28; utterance.**postUtteranceDelay** = 0.3; [self.synthesizer speakUtterance:utterance]; }总结
以上是内存溢出为你收集整理的AVSpeechSynthesizer – 如何检测点毫秒暂停(iPHONE – iPAD / iOS7 xcode)全部内容,希望文章能够帮你解决AVSpeechSynthesizer – 如何检测点毫秒暂停(iPHONE – iPAD / iOS7 xcode)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)