- ·上一篇文章:使用GDI图形设备接口进行绘图
- ·下一篇文章:使用C#自己制作字幕屏幕保护程序
在C#里面运用微软AGENT之TTS
AxAgent.EndInit();
}
protected void button2_Click(object sender, System.EventArgs e)
{
if(textBox1.Text.Length == 0)
return;
Character.Speak(textBox1.Text, null);
}
protected void button1_Click(object sender, System.EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.AddExtension = true;
openFileDialog.Filter = "Microsoft Agent Characters (*.acs)|*.acs";
openFileDialog.FilterIndex = 1 ;
openFileDialog.RestoreDirectory = true ;
if(openFileDialog.ShowDialog() != DialogResult.OK)
return;
try { AxAgent.Characters.Unload("CharacterID"); }
catch { }
AxAgent.Characters.Load("CharacterID", (object)openFileDialog.FileName);
Character = AxAgent.Characters["CharacterID"];
Character.LanguageID = 0x409;
Character.Show(null);
Character.Play ("announce");
Character.Speak ("welcome you sir",null);
} }
输出:
图2
结束语:
微软的Agent API提供了支持动画角色显示的服务,被配置为OLE Automation(COM)服务器时,它能够使多个被称为客户或客户端应用软件的应用程序同时托管或使用其动画、输入、输出服务。
!
在C#里面运用微软AGENT之TTS