So I am trying to write a text to speech program that will progressively get faster, leaving less of a gap between sentences and eventually over layering and running multiple of the commands at the same time so it becomes just a mess of noise. Its currently a console application and I have the relevant references included
Any ideas how I adapt this to run each speak command as its own instance. Would I have to re-learn how to multithread to get it to work?
Any help would be great, at the minute it loops (the number of iterations is not too important) and I have tried to get less of a pause after each one but cannot get one speak command to layer over the pervious.
for (int i = 0; i < 100; i++)
{
if (Console.KeyAvailable == true)
{
break;
}
else
{
if (i == 0)
{
string commandLine2 = "Hello darkness my old friend";
SpeechSynthesizer s = new SpeechSynthesizer();
s.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Child);
s.Speak(commandLine2);
commandLine2 = "Its been a while where should we begin";
//Thread.Sleep(1000);
s.Speak(commandLine2);
}
else
{
string commandLine2 = "Hello darkness my old friend";
SpeechSynthesizer s = new SpeechSynthesizer();
s.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Child);
s.Speak(commandLine2);
commandLine2 = "Its been a while where should we begin";
//Thread.Sleep(1000 / i);
s.Speak(commandLine2);
}
}
}
I just used multithreading in the end. It all came rushing back to me