Skip to content

Instantly share code, notes, and snippets.

@JorTurFer
Last active March 22, 2019 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JorTurFer/87c5462bd886eb644848810af91e065f to your computer and use it in GitHub Desktop.
Save JorTurFer/87c5462bd886eb644848810af91e065f to your computer and use it in GitHub Desktop.
It's necesary add a reference to System.Speech.dll
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Speech.Synthesis;
namespace Synthetizer
{
static class SintetizadorVoz
{
static SpeechSynthesizer m_Sintetizador = new SpeechSynthesizer();
static SintetizadorVoz()
{
m_Sintetizador.SetOutputToDefaultAudioDevice();
}
public static Prompt DecirAsync(string strFrase)
{
return m_Sintetizador.SpeakAsync(strFrase);
}
public static void Decir(string strFrase)
{
m_Sintetizador.Speak(strFrase);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment