Play voice words sounds using Console.Beep .Net

Kiquenet picture Kiquenet · Jan 22, 2013 · Viewed 14.6k times · Source

I use VS 2010, .Net 3.5, Win7 64 bits.

Can I use Console.Beep for "simule" human sounds (voice), maybe producing a synthesized voice sound ?

For example, using Beep for "simule" the sound of word "Error" ? any sample about it ?

Another samples using Console.Beep to play music chords and notes.

Is there any way I can get Console.Beep to play anything that sounds (voice, word Error) more like a chord or notes?

I want only use Console.Beep. (if it is possible,maybe) Simulation, not real voice. I don't mind it sounds like R2D2.

Beep
How can I make the computer beep in C#?

Play musical chords , notes
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/6620fd81-974a-40d1-8599-66d6c7c7d22d/

http://oguzkoroglu.net/post/2011/01/16/ConsoleBeep().aspx

Answer

Massimiliano Peluso picture Massimiliano Peluso · Jan 22, 2013

No IT IS NOT possible

you can find all you need in the System.Speech.Synthesis Namespace

using System;
using System.Speech.Synthesis;

namespace SampleSynthesis
{
  class Program
  {
    static void Main(string[] args)
    {

      // Initialize a new instance of the SpeechSynthesizer.
      SpeechSynthesizer synth = new SpeechSynthesizer();

      // Configure the audio output. 
      synth.SetOutputToDefaultAudioDevice();

      // Speak a string.
      synth.Speak("This example demonstrates a basic use of Speech Synthesizer");

      Console.WriteLine();
      Console.WriteLine("Press any key to exit...");
      Console.ReadKey();
    }
  }
}

The SpeechSynthesizer class provides access to the functionality of a speech synthesis engine that is installed on the host computer. Installed speech synthesis engines are represented by a voice, for example Microsoft Anna.

http://msdn.microsoft.com/en-us/library/system.speech.synthesis.speechsynthesizer.aspx