How can I get the phonics sound by pushing any letter key? For example, I want to get the phonics sound of A
by pushing the 'A' key.
I'm using Microsoft SAPI v5.1. Can you point me in the right direction please?
Add reference to System.Speech
assembly.
Add using System.Speech.Synthesis;
using (var speechSynthesizer = new SpeechSynthesizer())
{
speechSynthesizer.Speak("A");
speechSynthesizer.Speak("B");
speechSynthesizer.Speak("C");
}
For example like this:
using (var speechSynthesizer = new SpeechSynthesizer())
{
while (true)
{
var consoleKey = Console.ReadKey();
if (consoleKey.Key == ConsoleKey.Escape)
break;
var text = consoleKey.KeyChar.ToString();
speechSynthesizer.Speak(text);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With