当前位置:K88软件开发文章中心编程语言.NET.NET01 → 文章内容

在C#里面运用微软AGENT之TTS

减小字体 增大字体 作者:佚名  来源:翔宇亭IT乐园  发布时间:2018-12-31 11:45:33

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)服务器时,它能够使多个被称为客户或客户端应用软件的应用程序同时托管或使用其动画、输入、输出服务。


上一页  [1] [2] 


在C#里面运用微软AGENT之TTS