skip to Main Content

I am trying get timestamps for the generated audio using Azure Text to Speech. I have configured the speech config correctly but I can’t find any property related to timestamps in response object.
Following code is my code.

speech_config = speechsdk.SpeechConfig(subscription=speech_key, region=service_region)

speech_config.speech_synthesis_voice_name = "en-US-AndrewMultilingualNeural"
speech_config.request_word_level_timestamps()

text = "Hi"

# use the default speaker as audio output.
speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config)

result = speech_synthesizer.speak_text_async(text).get()
print(result.properties)

2

Answers


  1. To get timestamps in Azure Text to Speech synthesized audio, you need to use the SSML (Speech Synthesis Markup Language) with the wordBoundary or sentenceBoundary tag and enable the prosody feature.

    Use SSML with wordBoundary or sentenceBoundary:

    Azure Text to Speech supports adding SSML tags to capture word or sentence boundaries in the synthesized speech. These tags generate timestamps for each word or sentence.
    Enable Timestamps in API Request:

    You need to set the IncludeWordBoundary or IncludeSentenceBoundary in the synthesis request.

    Login or Signup to reply.
  2. To get timestamps in Azure Text to Speech synthesized audio, you need to use the SSML (Speech Synthesis Markup Language) with the wordBoundary or sentenceBoundary tag and enable the prosody feature.

    Use SSML with wordBoundary or sentenceBoundary:

    Azure Text to Speech supports adding SSML tags to capture word or sentence boundaries in the synthesized speech. These tags generate timestamps for each word or sentence. Enable Timestamps in API Request:

    You need to set the IncludeWordBoundary or IncludeSentenceBoundary in the synthesis request.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search