Play voice words sounds using Console.Beep .Net

15,171

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

Share:
15,171
Kiquenet
Author by

Kiquenet

Should "Hi", "Thanks" and taglines and salutations be removed from posts? http://meta.stackexchange.com/questions/2950/should-hi-thanks-and-taglines-and-salutations-be-removed-from-posts What have you tried? http://meta.stackexchange.com/questions/122986/is-it-ok-to-leave-what-have-you-tried-comments Asking http://stackoverflow.com/help/asking Answer http://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers http://www.enriquepradosvaliente.com http://kiquenet.wordpress.com ◣◥◢◤◢◤◣◥◢◤◢◤◣◥◢◤ ◥◢◤◢◤◣◥◢◤◢◤◣◥◢◤◢ .NET developer and fan of continuous self-improvement and good patterns and practices. Stuff I am interested in: .NET technology stack in general, C#, Powershell and Javascript in particular as languages Test driven development, DI, IoC and mocking frameworks Data access with ORMs and SQL ASP.NET javascript, jQuery and related frontend frameworks Open source projects

Updated on June 05, 2022

Comments

  • Kiquenet
    Kiquenet almost 2 years

    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

    • user1703401
      user1703401 over 11 years
      Human speech and music is a mix of a great number of frequencies whose intensity rapidly changes over time. Console.Beep() is capable of neither, it will never sound better than R2D2.
  • Kiquenet
    Kiquenet over 11 years
    which is the prerrequisites for use Speech.Synthesis ? any .net assembly ? any Win32 API or component installed in Windows?
  • Massimiliano Peluso
    Massimiliano Peluso over 11 years
    I have edited my answer. you need to add System.Speech as reference as well
  • Kiquenet
    Kiquenet over 11 years
    System.Speech works fine in Windows XP 32 bits, Windows 7 64 bits ? another system requeriment (any win32 api : kernel32,...) about System.Speech ?
  • Massimiliano Peluso
    Massimiliano Peluso over 11 years
    from windows XP works fine (you don't need to install anything as it is part of the windows installation)
  • Kiquenet
    Kiquenet over 11 years
    Only voice installed, Microsoft Anna (English United States). How can I installed more voice (Spanish) for System.Speech?
  • Massimiliano Peluso
    Massimiliano Peluso over 11 years
    you have to install a third part voice. I'm using this one for my project ivona.com/en