以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XML在语音技术中的应用 』   (http://bbs.xml.org.cn/list.asp?boardid=47)
----  OpenVXI3.4之问题请教。。。  (http://bbs.xml.org.cn/dispbbs.asp?boardid=47&rootid=&id=43662)


--  作者:qita2008
--  发布时间:3/6/2007 11:06:00 AM

--  OpenVXI3.4之问题请教。。。
在贵论坛找到了许多关于VXML的相关知识,很是感谢。

小弟遇到个问题,劳驾各高手解答。
在解析VXML时,当出现输入域时,解析器不能停止下来让我输入。。。直接运行到最后而结束。
小弟愚昧。。请高手指点。
<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
 <form id="credit_card_info">
  <block>We now need your credit card type, number, and expiration date.</block>
  <field name="card_type">
   <prompt>
    What kind of credit card do you have?
    1 visa 2 master
   </prompt>
   <grammar mode="dtmf" root="item1">
                  <rule id="item1">
                    <one-of>
                       <item>1</item>
                       <item>2</item>
                    </one-of>
                  </rule>
            </grammar>
    <catch event="noinput">
    Byebye!
    <disconnect/>
   </catch>

  </field>

  <filled>
           <if cond="card_type == 1">
               Your card_type is visa.      
           <elseif cond="card_type == 2"/>
               Your card_type are master .
           </if>
        </filled>
 </form>
</vxml>

拿这个VXML来说。。。解析器,没暂停让我输入。而直接catch noinput而挂断了。


--  作者:zhu_ruixian
--  发布时间:3/6/2007 8:26:00 PM

--  
VXIrec里面有个VXIrec.cpp文件,VXIrec.cpp里面有个VXIrecRecognize函数,VXIrecRecognize函数里面有如下内容:   
if (input && wcscmp(input, L"-") == 0) {
      unsigned int i;
      VXIchar* cp = console;
      char lbuf[512];
      printf("Console: ");
      fgets(lbuf, 511, stdin);
      // copy to VXIchar
      for(i = 0; i < strlen(lbuf); ++i) {
        if (lbuf[i] == '\r' || lbuf[i] == '\n') continue;
        *cp++ = lbuf[i] & 0x7f;
      }
      *cp++ = 0;
      input = console;
      logger.logDiag(DIAG_TAG_RECOGNITION, L"%s%s", L"Input: ",
                     (input ? input : L"NULL"));
    }
  }
你把上面的 if (input && wcscmp(input, L"-") == 0)   替换为 if (1) ,你就可以得到你想要的结果了。   Good Luck!
--  作者:qita2008
--  发布时间:3/7/2007 2:45:00 PM

--  
非常感谢版主的帮助。我目前再北京工做,我很想和你交个朋友。如果不介意的话能加个MSN吗?
q_gavin_q@hotmail.com
--  作者:zhu_ruixian
--  发布时间:3/7/2007 9:35:00 PM

--  
zrx285@163.com  我已经把你加上了。
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
62.988ms