从 .911 版开始,速度/音高/方差转换现在是 OpenEars 的一项功能。您可以按如下方式使用它:
使用 FliteController 的以下属性更改声音的速度、音调和可变性:
duration_stretch // Duration of speech
target_mean // Average pitch of speech
target_stddev // Variance
例如,在发送此消息之前:
[self.fliteController say:@"我想让我的应用大声说出来的一句话。" withVoice:@"cmu_us_awb8k"];
您可以对 self.fliteController 进行以下设置:
self.fliteController.duration_stretch = 1.5; // Slow down the speed a bit
self.fliteController.target_mean = 1.2; // Raise the pitch
self.fliteController.target_stddev = 1.5; // Increase the variance
1.0 是默认值,0.0 是最小值,2.0 是可能的最大有用值(尽管您可以高于 2.0,但它可能不会成为有用的值)。
0.5 的 duration_stretch 将是 1.0 的两倍,2.0 的 duration_stretch 将是 1.0 速度的一半。2.0 的 target_mean 或 target_stddev 将使平均音高频率加倍或方差加倍,而 0.5 会将它们减少一半。
您不必设置或覆盖这些设置 - 如果您不使用它们,它们将被设置为语音的默认值。如果您想在覆盖它们后将它们恢复为默认值,只需将它们全部设置为 1.0:
self.fliteController.duration_stretch = 1.0; // Reset the speed
self.fliteController.target_mean = 1.0; // Reset the pitch
self.fliteController.target_stddev = 1.0; // Reset the variance