AVSpeechSynthesizer – 如何检测点毫秒暂停(iPHONE – iPADiOS7 xcode)

AVSpeechSynthesizer – 如何检测点毫秒暂停(iPHONE – iPADiOS7 xcode),第1张

概述我想读一篇很长的文字: NSString *text =@"Long test with dot. I want speaching pause when read dot. How can I do?";AVSpeechSynthesizer *synthesizer = [AVSpeechSynthesizer new];[synthesizer setDelegate:self];AV 我想读一篇很长的文字:

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];

我想合成器检测点并暂停100毫秒.

可能吗?我能怎么做 ??

解决方法 我的意思是一个点(.)

但也许我找到了一个解决方案也是字符”,’:

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)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1015982.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存