Last active
March 22, 2019 15:44
-
-
Save JorTurFer/87c5462bd886eb644848810af91e065f to your computer and use it in GitHub Desktop.
It's necesary add a reference to System.Speech.dll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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