Ask Your Question
1

How can silence be added using AZURE text to speech?

asked 2022-08-14 11:00:00 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-01-23 23:00:00 +0000

qstack gravatar image

Silence can be added using AZURE text to speech by using the audio tag in the SSML (Speech Synthesis Markup Language) code. The audio tag syntax is as follows:

<break time="xms"/>

where x is the length of silence in milliseconds. For example, <break time="2000ms"/> will add a 2-second pause in the speech output.

To implement this in AZURE text to speech, follow these steps:

  1. Construct the SSML code with appropriate <speak> and <voice> tags as required.
  2. Insert the audio tag with the desired length of silence in milliseconds.
  3. Use the synthesize API to convert the SSML to audio.

Here's an example of how to add a 2-second pause in AZURE text to speech output:

<speak version="1.0" xmlns="https://www.w3.org/2001/10/synthesis" xml:lang="en-US">
  <voice name="en-US-JennyNeural">
    Hello, this is an example of how to add a pause using Azure text to speech.
    <break time="2000ms" />
    Did you hear that pause?
  </voice>
</speak>

When this SSML code is passed to the synthesize API in AZURE text to speech, the output will contain a 2-second silence after the phrase "this is an example of how to add a pause using Azure text to speech."

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-08-14 11:00:00 +0000

Seen: 11 times

Last updated: Jan 23 '22