Advertisement
hackthecode

Hello World - Cyrillic Output and SpeechSynthesizer

Oct 28th, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3. using System.Speech.Synthesis;
  4.  
  5.  
  6. class HelloWorld
  7. {
  8.     static void Main()
  9.     {
  10.         Console.OutputEncoding = Encoding.UTF8;
  11.         Console.WriteLine("Здравей Свят");
  12.  
  13.         using (SpeechSynthesizer synth = new SpeechSynthesizer())
  14.         {
  15.             synth.SetOutputToDefaultAudioDevice();
  16.             synth.Speak("Hello World");
  17.         }
  18.  
  19.         Console.WriteLine();
  20.         Console.WriteLine("Press any key to exit...");
  21.         Console.ReadKey();
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement