How to change speech speed(rate) when use "Input text streaming" in text to speech?

datou ai 0 Reputation points
2026-01-18T16:02:46.7866667+00:00

I have tried to set property(SpeechSynthesisReqest_Rate) but it doesn't work.

speech_config = speech_sdk.SpeechConfig(
    endpoint=endpoint,
    subscription=AZURE_TTS_API_KEY,
)
speech_config.set_property(
    speech_sdk.PropertyId.SpeechSynthesisRequest_Rate, "1.2"
 )
speech_config.set_speech_synthesis_output_format(
    speech_sdk.SpeechSynthesisOutputFormat.Ogg24Khz16BitMonoOpus
)
speech_synthesizer = speech_sdk.SpeechSynthesizer(
    speech_config=speech_config, audio_config=None
)
speech_synthesizer.synthesizing.connect(self.speech_event_callback)
tts_request = speech_sdk.SpeechSynthesisRequest( 
  input_type=speech_sdk.SpeechSynthesisRequestInputType.TextStream
)
Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
{count} votes

1 answer

Sort by: Most helpful
  1. Chakaravarthi Rangarajan Bhargavi 1,205 Reputation points MVP
    2026-01-19T01:34:13.92+00:00

    Welcome to Microsoft Q&A,

    What you’re seeing is actually expected behavior when using input text streaming with Azure Text-to-Speech.

    When you use:

    SpeechSynthesisRequestInputType.TextStream
    

    the service starts synthesizing audio immediately as text arrives. Because of that, request-level properties like SpeechSynthesisRequest_Rate are ignored. This isn’t a configuration issue in your code, the rate setting simply isn’t supported for text streaming today.

    That property works only when the full text is known in advance.

    If you need to control speaking speed, the only supported option is to use SSML prosody instead of plain text. In other words, you need to stream SSML, not raw text.

    So instead of TextStream, switch to SsmlStream and wrap your text like this:

    <prosody rate="1.2">Your text here</prosody>
    

    Once you do that, the speech rate will be applied correctly.

    Unfortunately, there’s no way right now to dynamically change speech speed for TextStream inputs, and the SDK doesn’t expose a client-side playback rate control for cloud TTS either. This is a current service limitation rather than a bug.

    If this behavior is important for your scenario, SSML streaming is the recommended workaround.

    Let us know if you need any further assistance, we’d be happy to help.

    Best regards,

    Chakravarthi Rangarajan Bhargavi

    If you find this answer helpful, please click Accept Answer and upvote. This helps others in the community find the solution more easily.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.