Buenas,

hoy me preguntaron si tenía algún ejemplo simple de utilización de las tecnologías de TextToSpeech incluidas en Vista o WS2008. Hace un tiempo hablé un poco de esto en una charla en Córdoba, pero si de memoria tengo que escribir algo, me sale lo siguiente (basado en SpeechSynthesizer):

1 using System; 2 using System.Speech.Synthesis; 3 4 namespace tts1 5 { 6 class Program 7 { 8 static void Main(string[] args) 9 { 10 SpeechSynthesizer ttsSynth = new SpeechSynthesizer(); 11 ttsSynth.SelectVoice("Microsoft Anna"); 12 string line = "Hi ... my name is Valentino"; 13 while (line.Length > 0) 14 { 15 ttsSynth.Speak(line); 16 line = Console.ReadLine(); 17 } 18 } 19 } 20 }

Proyecto de consola, con referencias a System.Speech, F5 y listo !!!

 

Saludos @ Here

El Bruno

PD: si lo que queremos es reconocer la voz … hace más tiempo aún escribí algo al respecto System.Speech, Hello World pero al reves

Crossposting from El Bruno