Click here to Skip to main content
14,830,018 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
Am enhancing an existing web application (Psychometric Test battery;using Asp.Net,C#,SqlServer)which is already being used by normal users as all of us; now we are enhancing the same for visually impaired persons

So I am thinking to implement this speech recognition in that with existing grid view; but am struggling with that;

In the existing one we have used gridview to load the data from db,now I can't able to read the record one by one using SpeechSynthesizer; It's keep on reading till end of  all the records. 

Here the code:

 <pre lang="c#">
SpeechSynthesizer sp1 = new SpeechSynthesizer();
 protected void btn_Spk_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow row in gvtemperament.Rows)
        {
            Label lbl1 = (Label)row.FindControl("lbl_desc");
            sp1.SelectVoiceByHints(VoiceGender.Male);
            sp1.Volume = 100;
            sp1.Rate = -3;
            sp1.SpeakAsync(lbl1.Text);
            Thread.Sleep(1500);
        }
    }

Can anyone please help me out on this?

And also I need to implement SpeechRecognition to make the system more flexible as a one to one conversation.

Regards,
Narendran Namachivayam.

What I have tried:

In the existing one we have used gridview to load the data from db,now I can't able to read the record one by one using SpeechSynthesizer; It's keep on reading till end of all the records.
Posted
Comments
   
This is because you read it all in your loop. If you want to read just one record, read just one record.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900