private void TrkSpeechRate_Scroll(object sender, EventArgs e) { synthSAPI.SpeakAsyncCancelAll(); int val = trkSpeechRate.Value; synthSAPI.SpeakAsync("rate " + val); val = val - 10; Properties.Settings.Default.SAPISpeechRate = val; synthSAPI.Rate = val; }
public void Asynth() { try { aSynth.SpeakAsyncCancelAll(); pBuilder.ClearContent(); pBuilder.AppendText(sentence); aSynth.Speak(pBuilder); } catch { return; } }
static void Main(string[] args) { System.Speech.Synthesis.SpeechSynthesizer synth = new System.Speech.Synthesis.SpeechSynthesizer(); List <InstalledVoice> voices = new List <InstalledVoice>(); voices.AddRange(synth.GetInstalledVoices(new CultureInfo("en-GB"))); voices.AddRange(synth.GetInstalledVoices(new CultureInfo("en-US"))); // synth.Voice. synth.SpeakAsync(@"one two three blarg! Shoe shop event horizon. bannana puding to the nth degree poisoning pigeons in the park"); Console.Read(); synth.SpeakAsyncCancelAll(); }
private void buttonCancel_Click(object sender, EventArgs e) { _synth.SpeakAsyncCancelAll(); }