黄大色黄大片女爽一次,丁香一区二区三区,精品一区日韩,www.国产网站,日韩欧美视频在线播放,性视频久久,欧美日日日日bbbbb视频

 首頁 > 技術(shù) > 技術(shù)文摘 > 基于VoiceXML的語音應(yīng)用系統(tǒng)開發(fā)

基于VoiceXML的語音應(yīng)用系統(tǒng)開發(fā)

2008-10-30 00:00:00   作者:   來源:   評(píng)論:0 點(diǎn)擊:


2008/10/30

一、概述


  本文中的信息查詢例子演示了一個(gè)簡(jiǎn)單的VoiceXML應(yīng)用。該例子VoiceXML腳本中用到的所有的標(biāo)簽如表1所示,表2是該例子的源代碼。圖四是該例子的呼叫流程。首先是用戶發(fā)起呼叫,應(yīng)用程序通過計(jì)算機(jī)合成語音(TTS)告訴用戶所有的選擇項(xiàng)并等待用戶的響應(yīng)。用戶的語音將由計(jì)算機(jī)根據(jù)語法標(biāo)簽

  中定義的規(guī)則進(jìn)行自動(dòng)識(shí)別。如果識(shí)別成功,標(biāo)簽中定義的變量“choice”被賦值。例如,如果用戶說出“weather”,則計(jì)算機(jī)會(huì)把字符串“weather” 賦值給“choice”。然后在標(biāo)簽中定義的條件判斷語句會(huì)根據(jù)變量“choice”的值把相應(yīng)的語音播放給用戶。如果用戶沒有響應(yīng),標(biāo)簽被執(zhí)行并把“I didn’t hear you” 播放給用戶,然后提示用戶重新輸入(標(biāo)簽)。同樣,如果用戶的語音沒有被識(shí)別,標(biāo)簽 將被執(zhí)行并告訴用戶“I didn’t quite understand you” ,然后提示用戶重新輸入(標(biāo)簽)。

表 1. 本示例中用到的VoiceXML 標(biāo)簽

圖四:信息查詢例子呼叫流程圖

表 2. 信息查詢例子源代碼

<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1" >
<form id="Choices">
<field name="choice">
<prompt>
Welcome to the Voice XML journey.
This tutorial demonstrates voice recognition.
Please choose from the followings:
to check the weather, say weather .
to check the stock quotes, say stock .
to get the direction information, say direction.
</prompt>
<grammar>
<![CDATA[ [
[weather dtmf-1]{<choice "weather">}
[stock dtmf-2]{<choice "stock">}
[direction dtmf-3]{<choice "direction">}
]
]]>
</grammar>
<noinput>
I didn't hear you. <reprompt/>
</noinput>
<nomatch>
I didn't quite understand you. <reprompt/>
</nomatch>
<filled>
<if cond="choice=='weather'">
<prompt>OK let's check the weather. Thank you. </prompt>
<elseif cond="choice=='stock'"/>
<prompt>OK let's check the stock quotes. Thank you. </prompt>
<else/>
<prompt>OK let's get the direction information. Thank you. </prompt>
</if>
</filled>
</field>
</form>
</vxml>

  該示例程序已經(jīng)部署在http://evolution.voxeo.com。讀者可以下列幾個(gè)途徑來執(zhí)行該示例程序:

  1. 通過Skype客戶端撥打號(hào)碼 +99000936 9992001335, 免費(fèi)呼叫。

  2. 通過Xlite(一個(gè)免費(fèi)的VoIP軟件)或者任何VoIP終端呼叫 sip:9992001335@sip.voxeo.net

  3. 通過手機(jī)或者固定電話撥打號(hào)碼 +1 407 459 1963(美國電話號(hào)碼,收費(fèi))。
  讀者可以訪問 http://docs.voxeo.com/voicexml/2.0/frame.jsp?page=learningvoicexml.htm 獲取更詳細(xì)的VoiceXML示例和教程,該網(wǎng)站也提供免費(fèi)注冊(cè),注冊(cè)后可以免費(fèi)發(fā)布自己的VoiceXML應(yīng)用和其他人共享(就象本文中的例子一樣)。

參考
[1]http://www.w3.org/TR/voicexml21/

CTI論壇編輯

相關(guān)閱讀:

分享到: 收藏

專題