選取您的 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:控制呼吸聲的長度。有效值為:defaultx-shortshortmediumlongx-long。預設值為 medium

  • volume:控制呼吸聲的音量。有效值為:defaultx-softsoftmediumloudx-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:控制呼吸聲的音量。有效值為:defaultx-softsoftmediumloudx-loud。預設值為 medium

  • frequency:控制呼吸聲在文字中發生的頻率。有效值為:defaultx-lowlowmediumhighx-high。預設值為 medium

  • duration:控制呼吸聲的長度。有效值為:defaultx-shortshortmediumlongx-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.或其附屬公司。保留所有權利。