Reputation: 234
string TextToBeRead = "My sample text";
SpeechSynthesizer speaker = new SpeechSynthesizer();
speaker.Rate = 5;
speaker.Volume = 70;
speaker.SpeakAsync(TextToBeRead);
Is there any way to change the rate or volume, once the speaker starts talking? I have tried to change it at runtime but output still uses old rate and volume. Thanks.
Upvotes: 2
Views: 1514
Reputation: 13932
You can do this inline using the SSML prosody element, and the rate and volume attributes.
You'll need to use the SpeakSsmlAsync method on SpeechSynthesizer to make this work.
Upvotes: 1
Reputation: 13138
No you can't change it while it's reading but you can subscribe to SpeakProgress
event so you can get the CharacterPosition
and restart speak with a new rate and volume at given position
Upvotes: 2