选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

添加呼吸音

聚焦模式
添加呼吸音 - Amazon Polly

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

<amazon:breath> 和 <amazon:auto-breaths>

只有标准 TTS 格式支持此标签。

自然声音语音包括正确说出的字词和呼吸音。通过向合成语音添加呼吸音,可以使合成语音听起来更自然。<amazon:breath><amazon:auto-breaths> 标签可提供呼吸。您有以下选项:

  • 手动模式:您可以在文本中设置呼吸音的位置、长度和音量

  • 自动模式:Amazon Polly 自动将呼吸音插入语音输出

  • 混合模式:由您和 Amazon Polly 共同添加呼吸音

手动模式

在手动模式下,可将 <amazon:breath/> 标签放在要插入呼吸的输入文本中。您可以分别使用 durationvolume 属性自定义呼吸的长度和音量:

  • duration:控制呼吸的长度。有效值为: default, x-short, short, medium, long, x-long。默认值为 medium

  • volume:控制呼吸音有多大声。有效值为: default, x-soft, soft, medium, loud, x-loud。默认值为 medium

注意

每个属性值的确切长度和音量取决于使用的具体 Amazon Polly 语音。

要使用默认值设置呼吸音,请不带属性使用 <amazon:breath/>

例如,要使用属性将呼吸的持续时间和音量设置为中等,可以按如下方式设置属性:

<speak> Sometimes you want to insert only <amazon:breath duration="medium" volume="x-loud"/>a single breath. </speak>

要使用默认值,只需使用标签:

<speak> Sometimes you need <amazon:breath/>to insert one or more average breaths <amazon:breath/> so that the text sounds correct. </speak>

您可以在一个段落内添加个别呼吸音,如下所示:

<speak> <amazon:breath duration="long" volume="x-loud"/> <prosody rate="120%"> <prosody volume="loud"> Wow! <amazon:breath duration="long" volume="loud"/> </prosody> That was quite fast. <amazon:breath duration="medium" volume="x-loud"/> I almost beat my personal best time on this track. </prosody> </speak>
自动模式

在自动模式下,您使用 <amazon:auto-breaths> 标签来告知 Amazon Polly 以适当的时间间隔自动产生呼吸音。您可以设置间隔的频率、音量和持续时间。将 </amazon:auto-breaths> 标签放在要应用自动呼吸的文本的开头,然后将结束标签放在文本末尾。

注意

与手动模式标签 <amazon:breath/> 不同,<amazon:auto-breaths> 标签必须具有结束标签 (</amazon:auto-breaths>)。

您可以将以下可选属性与 <amazon:auto-breaths> 标签结合使用:

  • volume:控制呼吸音有多大声。有效值为: default, x-soft, soft, medium, loud, x-loud。默认值为 medium

  • frequency:控制文本中出现呼吸音的频率。有效值为: default, x-low, low, medium, high, x-high。默认值为 medium

  • duration:控制呼吸的长度。有效值为: default, x-short, short, medium, long, x-long。默认值为 medium

默认情况下,呼吸音的频率取决于输入文本。但是,呼吸音通常发生在逗号和句点之后。

以下示例显示如何使用 <amazon:auto-breaths> 标签。要确定对您的内容使用哪些选项,请将适用的示例复制到 Amazon Polly 控制台并听其中的差异。

  • 不带可选参数使用自动化模式。

    <speak> <amazon:auto-breaths>Amazon Polly is a service that turns text into lifelike speech, allowing you to create applications that talk and build entirely new categories of speech- enabled products. Amazon Polly is a text-to-speech service that uses advanced deep learning technologies to synthesize speech that sounds like a human voice. With dozens of lifelike voices across a variety of languages, you can select the ideal voice and build speech- enabled applications that work in many different countries.</amazon:auto-breaths> </speak>
  • 将自动化模式与音量控制结合使用。未指定的参数 (durationfrequency) 设置为默认值 (medium)。

    <speak> <amazon:auto-breaths volume="x-soft">Amazon Polly is a service that turns text into lifelike speech, allowing you to create applications that talk and build entirely new categories of speech-enabled products. Amazon Polly is a text-to-speech service, that uses advanced deep learning technologies to synthesize speech that sounds like a human voice. With dozens of lifelike voices across a variety of languages, you can select the ideal voice and build speech- enabled applications that work in many different countries.</amazon:auto-breaths> </speak>
  • 将自动化模式与频率控制结合使用。未指定的参数 (durationvolume) 设置为默认值 (medium)。

    <speak> <amazon:auto-breaths frequency="x-low">Amazon Polly is a service that turns text into lifelike speech, allowing you to create applications that talk and build entirely new categories of speech-enabled products. Amazon Polly is a text-to-speech service, that uses advanced deep learning technologies to synthesize speech that sounds like a human voice. With dozens of lifelike voices across a variety of languages, you can select the ideal voice and build speech- enabled applications that work in many different countries.</amazon:auto-breaths> </speak>
  • 将自动化模式与多个参数结合使用。对于未指定的 Duration 参数,Amazon Polly 将使用默认值 (medium)。

    <speak> <amazon:auto-breaths volume="x-loud" frequency="x-low">Amazon Polly is a service that turns text into lifelike speech, allowing you to create applications that talk and build entirely new categories of speech-enabled products. Amazon Polly is a text-to-speech service, that uses advanced deep learning technologies to synthesize speech that sounds like a human voice. With dozens of lifelike voices across a variety of languages, you can select the ideal voice and build speech-enabled applications that work in many different countries.</amazon:auto-breaths> </speak>

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。