Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Csharp.net
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
(no name)131.6K
v2

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

  Print Answers RSS
0 OriginalGriff 315
1 Jochen Arndt 190
2 DamithSL 125
3 PIEBALDconsult 110
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 3 Apr 2013
Copyright © CodeProject, 1999-2014
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