?? microsoft agent.html
字號:
<p><font size="3"><font color="#ffffff">----</font> ④Connected屬性:Agent是否與Microsoft Agent服務器連接。
<br>
<font color="#ffffff">----</font> MyAgent.Connected := True;</font>
<p><font size="3"><font color="#ffffff">----</font> ⑤Get_Height、Get_Width、Set_Height、Set_Width方法:獲得、設置Agent動畫人物的高度、寬度。
<xmp> AgentHight := Peedy.Get_Height; AgentWidth := Peedy.Get_Width; Peedy.Set_Height(
round(AgentHeight / 2 )); Peedy.Set_Width( round( AgentWidth / 2 )); </xmp>
</font>
<p><font size="3"><font color="#ffffff">----</font> ⑥MoveTo方法:參數x,y表示Agent動畫人物移動到的坐標,參數Speed表示移動的速度。</font>
<p><font color="#ffffff"><font size="3">----</font></font> <font size="3"> Peedy.MoveTo( (Screen.Width-Peedy.Get_Width)
Div 2, (Screen.Height-Peedy.Get_Height) Div 2, 2 );</font>
<p><font size="3"><font color="#ffffff">----</font> ⑦Interrupt方法:中斷指定角色的動畫。在幾十種動畫動作中,有一類后綴名為“ing”
的動作比較特殊,如“processing”、“searching”、“reading”、“writing”,一旦執行就必須通過調用另外一個動畫人物的Interrupt方法才能中斷
。角色不能中斷自身的動作,否則會導致異常。 <xmp> Request1 := Robby.Play('reading'); Peedy.Interrupt(Request1);
</xmp>
</font>
<p><font size="3"><font color="#ffffff">----</font> ⑧Wait方法:在多個不同動畫人物之間協調動畫動作,如等待sRobby的當前動作執行完畢后,Peedy做另外一個動作。
<xmp> Request1 := Robby.Play('read'); Peedy.Wait(Request1); Peedy.Play('search');
</xmp>
</font>
<p><font size="3"><font color="#ffffff">----</font> ⑨Play方法:執行指定的動畫動作,參數Animation為一常量,表示動畫類型。Agent提供了幾十種預定義動作,開發軟件時只需直接調用這些常量即可。下面簡要介紹其中常用的一些常量僅供編程參考。</font>
<p><font color="#ffffff"><font size="3">----</font></font> <font size="3"> 動作類型 中文含意 動作類型 中文含意 動作類型 中文含意 <xmp>
Acknowledge 承認 LookDown 向下看 Sad 悲傷 Alert 警告 LookDownBlink 向下看眨眼 Search
尋找 Announce 聲明 LookUp 向上看 StartListening 開始聆聽 Blink 眨眼 LookUpBlink 向下看眨眼
StopListening 停止聆聽 Confused 迷惑 LookLeft 向左看 Suggest 建議 Congratulate 祝賀
LookLeftBlink 向左看眨眼 Surprised 吃驚 Decline 拒絕 LookRight 向右看 Think 思考 DontRecognize
不承認 LookRightBlink 向右看眨眼 Wave 揮動 Explain 解釋 MoveDown 向下移動 Write 書寫 GestureDown
向下姿勢 MoveUp 向上移動 Processing 計算…… GestureUp 向上姿勢 MoveRight 向右移動 Reading
閱讀…… GestureLeft 向左姿勢 MoveLeft 向左移動 Searching 尋找…… GestureRight 向右姿勢 Pleased
高興 Writing 書寫…… GetAttention 獲得注意 Read 閱讀 Greet 問候 RestPose 恢復初始狀態 Request
:= peedy.Play('search'); </xmp>
</font>
<p><font size="3"><font color="#ffffff">----</font> ⑩Speak方法:Agent通過調用語音合成引擎,支持英語的語音合成輸出功能,只需輸入英文字符串,Agent就能通過聲卡、音箱“說話”。Agent的當前版本尚不具備支持中文語音合成功能,所以只能以.wav文件的形式播放中文。使用時可以將想要說的中文句子預先錄好,以.wav形式存儲,在程序中調用即可。參數Text表示文字氣球中顯示的文字,參數url表示.wav文件的路徑。</font>
<p><font color="#ffffff"><font size="3">----</font></font> <font size="3"> Peedy.speak('嗨,朋友們,你們好,現在由我為您提供幫助!','C:\新建文件夾\Help.wav');</font>
<p><font size="3"><font color="#ffffff">----</font> Peedy.Speak( 'Do you like my help?
If so, Please send me an email! Thank you!', '' );</font>
<p><font size="3"><font color="#ffffff">----</font> ⑾Commands.Add方法:在Button1Click事件中為Agent添加自定義語音識別命令,參數const
Name表示語音命令的標識,參數Caption表示該命令在輸入命令窗口中的顯示標題,參數Voice表示該命令對應的語句。當用戶通過麥克風向動畫人物發出語音命令時,觸發Agent的Command事件,因此我們可以另外編寫一個過程完成語音識別功能。
<xmp> procedure TForm1.Button1Click(Sender: TObject); begin Peedy.Commands.Add('Delphi','Run
Delphi','Delphi',True,True); Peedy.Commands.Add('Visual Basic',' Run VB','VB',True,True);
Peedy.Show(0); Peedy.Speak('What can I do for you, sir?',''); end; </xmp>
</font>
<p><font size="3"><font color="#ffffff">----</font> ⑷、按F9運行程序。以上程序在Delphi3.0/4.0、Windows95/98/NT簡體中文版環境下調試通過。
<!-- #EndEditable --></font></td>
</tr>
<tr>
<td width="582"><font size="3"><!-- #BeginEditable "%B1%B8%D7%A2" --></font><!-- #EndEditable --></td>
</tr>
</table>
<font size="3">
<br>
</font>
<hr size="1">
<table width="25%" border="1" align="center" cellspacing="0" cellpadding="0" bordercolorlight="#CCCCFF" bordercolordark="#000033" bordercolor="#6666FF">
<tr align="center">
<td> <font size="3"> 轉載請注明出于 <a href="http://fwolf.yeah.net" target="_blank">獨孤之所</a><!--Fwolf出品
fwolf001@163.net
http://fwolf.yeah.net --> </font> </td>
</tr>
<tr align="center">
<td>
<font size="3">
<script>document.write("<a href=http://www.topcn.com/siteinfo.asp?UserName=fwolf2000&SiteType=0 target=_blank><img src=http://www1.topcn.com:8081/statistics.asp?fwolf2000&referURL="+escape(top.document.referrer)+"&curURL="+escape(top.document.URL)+"&imgStyle=0"+" border=0 alt='Top中文網站龍虎榜' ></a>");</script>
</font>
<script>document.write("<a href=http://www.textclick.com/viewmain.asp?name=fwolf2000 target=_blank><img src=http://ad.t2t2.com/stat.asp?user=fwolf2000&refer="+escape(document.referrer)+"&cur="+escape(document.URL)+" alt=太極統計 border=0></a>");</script>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellspacing="1" bgcolor="#66FF66">
<tr>
<td width="10%"><a href="javascript:window.close()"><font size="3">[關閉窗口]</font></a></td>
<td width="90%">
<div align="left"></div>
</td>
</tr>
</table>
<div id="Layer1" style="position:absolute; width:470px; height:60; z-index:1; left: 293px; top: 13px; overflow: hidden">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="60">
<tr>
<td>
</td>
</tr>
</table>
</div>
<div align="center"></div>
<p align="center">
<script language="JavaScript1.1" src=http://ad.t2t2.com/textclick.asp?user=fwolf&style=4&bkcolor=no></script>
</p>
<p align="center"> </p>
</body>
<!-- #EndTemplate --></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -