admin管理员组文章数量:1336576
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)
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)
Share
Improve this question
asked Nov 21, 2024 at 7:21
Axen_RangsAxen_Rangs
4273 gold badges9 silver badges24 bronze badges
1 Answer
Reset to default 0To 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.
本文标签: pythonHow to get timestamps in Azure text to Speech Synthesized AudioStack Overflow
版权声明:本文标题:python - How to get timestamps in Azure text to Speech Synthesized Audio - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742306585a2450035.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论