Advertisement
Dennisaa

Untitled

Mar 7th, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2. using System.Speech.Synthesis;
  3.  
  4. namespace ConsoleApplication19 {
  5.     class Program {
  6.         static void Main(string[] args) {
  7.             var synth = new SpeechSynthesizer();
  8.  
  9.             // Configure the audio output.
  10.             synth.SetOutputToDefaultAudioDevice();
  11.  
  12.             char keyStroke;
  13.             do {
  14.                 // Speak a string.
  15.                 synth.Speak("This example demonstrates a basic use of Speech Synthesizer");
  16.  
  17.                 Console.WriteLine();
  18.                 Console.WriteLine("Press lower case [x] to exit." );
  19.                 var x = Console.ReadKey();
  20.                 keyStroke =  x.KeyChar;
  21.             } while (keyStroke != 'x');
  22.  
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement