I think there is no point to confuse with the remote web server and the browser where we are browsing and all.
ss.SelectVoiceByHints(VoiceGender.Female);
ss.Volume = 100;
ss.Rate = -3;
pb.ClearContent();
pb.AppendText("Please answer all the Questions and you starts here!");
ss.Speak(pb);
Thread.Sleep(TimeSpan.FromMilliseconds(1000));
pb.ClearContent();
pb.AppendText(lbl1.Text);
ss.Speak(pb);
Thread.Sleep(TimeSpan.FromMilliseconds(1000));
ss.SelectVoiceByHints(VoiceGender.Male);
pb.ClearContent();
pb.AppendText("Options are ");
ss.Speak(pb);
optiona = rblist1.Text;
optionb = rblist2.Text;
optionc = "Not Sure";
pb.ClearContent();
pb.AppendText(optiona);
ss.Speak(pb);
Thread.Sleep(TimeSpan.FromMilliseconds(700));
pb.ClearContent();
pb.AppendText(optionb);
ss.Speak(pb);
Thread.Sleep(TimeSpan.FromMilliseconds(700));
pb.ClearContent();
pb.AppendText(optionc);
ss.Speak(pb);
Choices clist = new Choices(new string[] { "Yes", "No", "Not Sure" });
GrammarBuilder gb = new GrammarBuilder();
gb.Append(clist);
// Construct a Grammar object and load it to the recognizer.
Grammar gr = new Grammar(gb);
sre.LoadGrammarAsync(gr);
sre.SetInputToDefaultAudioDevice();
sre.RequestRecognizerUpdate();
sre.InitialSilenceTimeout = TimeSpan.FromSeconds(3);
sre.BabbleTimeout = TimeSpan.FromMilliseconds(500);
sre.EndSilenceTimeout = TimeSpan.FromSeconds(1);
sre.EndSilenceTimeoutAmbiguous = TimeSpan.FromSeconds(1.5);
var result = sre.Recognize();
if (result.Text == "Yes")
{
rblist1.Checked = true;
break;
}
else if (result.Text == "No")
{
rblist2.Checked = true;
break;
}
else if (result.Text == "Not Sure")
{
rblist3.Checked = true;
break;
}
else
{
rblist1.Checked = false;
rblist2.Checked = false;
rblist3.Checked = false;
break;
}
}
This is the code working as of now, but at the end the page is keep on loading and nothing happened, hope once the page loaded ended the option button will be selected.
None
0 Points
8 Posts
Re: Speech Recognition is not working in Web application
Jul 29, 2016 04:17 AM|N4Narendran|LINK
I think there is no point to confuse with the remote web server and the browser where we are browsing and all.
This is the code working as of now, but at the end the page is keep on loading and nothing happened, hope once the page loaded ended the option button will be selected.
Help me on this, why the page is keep on loading?