110,533
社区成员
发帖
与我相关
我的任务
分享
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 SpeechLib;
namespace pro2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
SpeechLib.SpVoice Voice = new SpVoiceClass();
private void Form1_Load(object sender, EventArgs e)
{
Voice.Viseme += new _ISpeechVoiceEvents_VisemeEventHandler(Voice_Viseme);
}
private void button1_Click(object sender, EventArgs e)
{
Voice.Speak(textBox1.Text, SpeechVoiceSpeakFlags.SVSFlagsAsync);
}
void Voice_Viseme(int StreamNumber, object StreamPosition, int Duration, SpeechVisemeType NextVisemeId, SpeechVisemeFeature Feature, SpeechVisemeType CurrentVisemeId)
{
label1.Text += "CurrentVisemeId:" + CurrentVisemeId.ToString() + "\n";
}
}
}
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SpeechLib;
namespace myspeak
{
public partial class MySpeak : System.Web.UI.Page
{
SpeechLib.SpVoice Voice = new SpVoiceClass();
protected void Page_Load(object sender, EventArgs e)
{
Voice.Viseme += new _ISpeechVoiceEvents_VisemeEventHandler(Voice_Viseme);
}
void Voice_Viseme(int StreamNumber, object StreamPosition, int Duration, SpeechVisemeType NextVisemeId, SpeechVisemeFeature Feature, SpeechVisemeType CurrentVisemeId)
{
lbl.Text += "Voice_Viseme:" + CurrentVisemeId.ToString();
}
protected void Button1_Click1(object sender, EventArgs e)
{
Voice.Speak("hello", SpeechVoiceSpeakFlags.SVSFlagsAsync);
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Voice.Viseme += new _ISpeechVoiceEvents_VisemeEventHandler(Voice_Viseme);
}
}