Click here to Skip to main content
12,065,204 members (46,285 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
Dear All,
I need solution for making current word high-lighted being read by SpeackAsync method.
Example:-Robin is a good boy.

in this if SpeakAsync reading at is then is should be highlight.

Plz look at given coding,,,,,,,

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Speech.Synthesis;
using System.IO;
namespace text_to_speech
{
    public partial class Form1 : Form
    {
        SpeechSynthesizer reader;
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            reader = new SpeechSynthesizer();
            btnPause.Enabled = false;
            btnResume.Enabled = false;
            btnStop.Enabled = false;
            xtxtContent.ScrollBars = ScrollBars.Both;
            
            volumebar.Maximum = 100;
            speedbar.Maximum = 10;
            speedbar.Minimum = -5;
            volumebar.Value = 50;
           
        }
        //SPEAK TEXT
        private void button1_Click(object sender, EventArgs e)
        {
            reader.Dispose();
            if (xtxtContent.Text != "")
            {
                reader = new SpeechSynthesizer();
                reader.Volume = volumebar.Value;
                reader.Rate = speedbar.Value;
                
                reader.SpeakAsync(xtxtContent.Text);
                label2.Text = "SPEAKING";
                btnPause.Enabled = true;
                btnStop.Enabled = true;
                reader.SpeakCompleted += new EventHandler<SpeakCompletedEventArgs>(reader_SpeakCompleted);
            }
            else
            {
                MessageBox.Show("Please enter some text in the textbox", "Message", MessageBoxButtons.OK);
            }
        }
        void reader_SpeakCompleted(object sender, SpeakCompletedEventArgs e)
        {
            label2.Text = "IDLE";
        }
[Edit]Code block added[/Edit]
Posted 2-Apr-13 22:23pm
Edited 2-Apr-13 22:26pm
ProgramFOX178.2K
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160204.4 | Last Updated 3 Apr 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100