【发布时间】:2014-09-27 09:42:24
【问题描述】:
我想在朗读文本时更改语速以了解速度。
我测试了以下两种方式,但语速没有改变。
- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer willSpeakRangeOfSpeechString:NSRange)characterRange utterance:(AVSpeechUtterance *)utterance{
// 1. AVSpeechUtterance *SpeechUtterence;
SpeechUtterence.rate = fSpeechSpeed;
// 2. set fSpeechSpeed from other view
utterance.rate = fSpeechSpeed;
}
【问题讨论】:
-
fSpeechSpeed的值是多少? -
fSpeechSpeed 变量是从其他视图设置的。
-
是的,但它的价值是什么?我的意思是,它是0.5吗? 1? 42?
AVSpeechUtterance的rate的有效值范围有限。 -
是的,范围是0.0f ~ 1.0f
标签: ios text-to-speech avspeechsynthesizer