如何使用 FliteController 类中的 withVoice: 参数减慢语音速度?

发布于 2024-11-13 08:42:41 字数 480 浏览 0 评论 0原文

我正在使用 OpenEars FliteController 类将文本转换为语音。

我正在使用以下方法:

[self.fliteController say:@"Aphrase Id like my app to say outloud." withVoice:@"cmu_us_awb8k"];

在 withVoice: 之后可以输入的参数选项如下:

cmu_us_awb8k
cmu_us_rms8k
cmu_us_slt8k
cmu_time_awb
cmu_us_awb
cmu_us_kal
cmu_us_kal16
cmu_us_rms
cmu_us_slt

我用 withVoice: 尝试了所有这些参数,

但是,我的客户对这些声音不满意。他告诉我这些都很快。因此,我需要一种使用 withVoice: 参数来减慢语音速度的方法。我该怎么做呢?还有其他语音可用吗?

I am using the OpenEars FliteController class to convert text to speech.

I am using the method:

[self.fliteController say:@"A phrase I'd like my app to speak out loud." withVoice:@"cmu_us_awb8k"];

The options for arguments one can enter after withVoice: are as follows:

cmu_us_awb8k
cmu_us_rms8k
cmu_us_slt8k
cmu_time_awb
cmu_us_awb
cmu_us_kal
cmu_us_kal16
cmu_us_rms
cmu_us_slt

I tried all of these arguments with withVoice:

However, my client is not happy with the voices. He told me these all are fast. So, I need a way to slow down speech using the withVoice: argument. How can I do it? Are there any other speech voices available?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

坦然微笑 2024-11-20 08:42:41

自 0.911 版本起,速度/音高/方差变换现已成为 OpenEars 的一项功能。您可以按如下方式使用它:

使用 FliteController 的以下属性更改声音的速度、音调和变化性:

duration_stretch // Duration of speech
target_mean // Average pitch of speech
target_stddev // Variance

例如,在发送此消息之前:

[self.fliteController say:@"Aphrase Id like my app大声说话。” 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,但它可能不会是一个有用的值) 。

uration_stretch 为 0.5 时,速度是 1.0 的两倍,duration_stretch 为 2.0 时,速度是 1.0 的一半。 target_mean 或 target_stddev 为 2.0 将使平均音调频率或方差加倍,而 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

Speed/pitch/variance shift is now a feature of OpenEars as of version .911. You can use it as follows:

Change the speed, pitch and variability of a voice by using the following properties of FliteController:

duration_stretch // Duration of speech
target_mean // Average pitch of speech
target_stddev // Variance

For instance, right before sending this message:

[self.fliteController say:@"A phrase I'd like my app to speak out loud." withVoice:@"cmu_us_awb8k"];

You could make the following settings to 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 is the default, 0.0 is the minimum value and 2.0 is a likely maximum useful value (although you can go higher than 2.0, it probably isn't going to be a useful value).

A duration_stretch of .5 will be twice as fast as 1.0, a duration_stretch of 2.0 will be half the speed of 1.0. A target_mean or target_stddev of 2.0 will double the average pitch frequency or double the variance, while 0.5 will reduce them by half.

You do not have to set or override these settings — if you don’t use them, they will be set to the defaults for the voice. If you want to return them to the defaults after overriding them, simply set them all to 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
冰雪梦之恋 2024-11-20 08:42:41

我相信这是 OpenEars 的成果。不知道如何在 OpenEars 中进行配置。但是您可以查看此演示,它可以根据您的要求进行自定义。就像您可以设置声音的音高/方差/速度一样。从链接克隆存储库。

如果您可以迁移到此,这将是您的解决方案。如果您对此演示有任何疑问,我一定可以提供帮助,因为我为 TextToSpeech 准备了 1 个带有播放/暂停/停止选项的演示。

希望有帮助。

I believe this is with OpenEars. Don't know about configuring this in OpenEars. But you can have a look at this demo which can be customizable as per your requirement. Like you can set Pitch/Variance/Speed for the voices. Clone the repository from the link.

If you can migrate to this it would be your solution. If you have any doubt in this demo I can surely help as I prepared 1 demo with Play/Pause/Stop options for TextToSpeech.

Hope it helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文