• <strike id="fdgpu"><input id="fdgpu"></input></strike>
    <label id="fdgpu"></label>
    <s id="fdgpu"><code id="fdgpu"></code></s>

  • <label id="fdgpu"></label>
  • <span id="fdgpu"><u id="fdgpu"></u></span>

    <s id="fdgpu"><sub id="fdgpu"></sub></s>
     首頁 > 技術(shù) > 技術(shù)文摘 > 基于VoiceXML的語音應(yīng)用系統(tǒng)開發(fā)

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

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


    2008/10/30

    一、概述


      本文中的信息查詢例子演示了一個(gè)簡單的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)識別。如果識別成功,標(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)簽)。同樣,如果用戶的語音沒有被識別,標(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客戶端撥打號碼 +99000936 9992001335, 免費(fèi)呼叫。

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

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

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

    CTI論壇編輯

    相關(guān)閱讀:

    分享到: 收藏

    專題

    亚洲精品网站在线观看不卡无广告,国产a不卡片精品免费观看,欧美亚洲一区二区三区在线,国产一区二区三区日韩 库尔勒市| 沭阳县| 名山县| 云安县| 从化市| 封丘县| 丰镇市| 德兴市| 镇平县| 富宁县| 鹤庆县| 达州市| 海口市| 唐河县| 元江| 甘肃省| 来宾市| 海伦市| 石楼县| 奈曼旗| 宁乡县| 洪洞县| 星座| 封丘县| 正宁县| 井冈山市| 禄丰县| 夏河县| 乾安县| 理塘县| 民勤县| 龙游县| 衡山县| 汤阴县| 剑川县| 临桂县| 乳山市| 邵东县| 延寿县| 隆化县| 铜川市| http://444 http://444 http://444 http://444 http://444 http://444