是否可以在AVSpeechSynthesizer的声音中改变声音的音高? [英] is it possible to change the pitch of the voice in AVSpeechSynthesizer's voice?

查看:127
本文介绍了是否可以在AVSpeechSynthesizer的声音中改变声音的音高?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在AVSpeechSynthesizer中改变声音的音高,还是对输出声音产生任何影响,使声音听起来不同?

Can I change the pitch of the voice in AVSpeechSynthesizer or putting any effects on the output voice from it so it could sound differently?

推荐答案

是的,您可以更改口语句子的音高

Yes, you can change the pitch and the rate of the spoken sentence.

AVSpeechUtterance class有两个相关属性:

The AVSpeechUtterance class has two relevant properties:


  • pitchMultiplier:Float 0.5 (最低音高)到 2.0 (最高音高)之间的值)。默认音高 1.0

  • rate:Float (两个常量之间的值: AVSpeechUtteranceMinimumSpeechRate (最慢的讲话率)和 AVSpeechUtteranceMaximumSpeechRate (最高讲话率)。

  • pitchMultiplier: Float (value between 0.5 (lowest pitch) to 2.0 (highest pitch)). The default pitch is 1.0.
  • rate: Float (value between two constants: AVSpeechUtteranceMinimumSpeechRate (the slowest rate of speech) and AVSpeechUtteranceMaximumSpeechRate (the highest rate of speech).

当你创建 AVSpeechUtterance 时,只需在获得 AVSpeechSynthesizer 说出话语。

When you create your AVSpeechUtterance, simply set these properties appropriately before getting your AVSpeechSynthesizer to speak the utterance.

注意:你也可以改变声音(重音)AVSpeechUtterance

Note: You can also change the voice (accent) of AVSpeechUtterance.

我希望这会有所帮助。如果我说的话不清楚,请告诉我。

I hope this helps. Let me know if anything I said was unclear.

这篇关于是否可以在AVSpeechSynthesizer的声音中改变声音的音高?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆