Click here to Skip to main content
15,911,327 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Need some Help, Please
I am very new to programming.
Could anyone tell me where i am going wrong.
Can't get this code to work.
I ve tried every thing that I could find online.
I have been at this for over 3 weeks now.
I don't want to giveup on it, there has got to be a way.

Thanks



C#
using System;
using System.Collections.Generic;
using System.Componentmodel;
using System.Data;
using System.Drawing;
using System.Ling;
using System.Text;
using System.Window.forms;
using SpeechLib;
using System.Speech.Synthesis;


namespace Visemeintextbox
{

public partial class Form1 : Form
{
    public SpeechLib.SpVoice vox;
    
    public Form1()
    {
       InitializeComponent();
    }
    
    private void Form1_Load(System.object sender,System.EventArgs e)
    {
       vox=new SpVoice();
       this.Text1.Text="This is text is a textbox";
    }
    
    private void Command1_Click(System.object sender,System.EventArgs e)
    {
       vox.Speak(this.Text1.Text,SpeechVoiceSpeakFlags.SVSFlagsAsync);
    }
    
    private void vox_Viseme(long StreamNumber,object StreamPosition,long Duration,
                            SpeechLib.SpeechVisemeType NextVisemeId,
                            SpeechLib.SpeechVisemeFeature Feature,
                            SpeechLib.SpeechVisemeType CurrentVisemeId)
    
    {
       this.Text2.Text=this.Text2.Text+CurrentVisemeId+" ";
    }

} 

}
Posted
Updated 13-May-12 8:31am
v2
Comments
VJ Reddy 13-May-12 14:31pm    
Edit: pre tag for C# code added.

1 solution

try this...

C#
private void Command1_Click(object sender, EventArgs e)
        {
            SpVoice vox = new SpVoice();
            vox.Speak(this.Text1.Text,SpeechVoiceSpeakFlags.SVSFlagsAsync);
            vox.Viseme += new _ISpeechVoiceEvents_VisemeEventHandler(vox_Viseme);
        }

        void vox_Viseme(int StreamNumber, object StreamPosition, int Duration, SpeechVisemeType NextVisemeId, SpeechVisemeFeature Feature, SpeechVisemeType CurrentVisemeId)
        {
            this.Text2.Text = this.Text2.Text + CurrentVisemeId + " ";
        }
 
Share this answer
 

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