我正在查看一些来自vxml.org的示例VXML脚本。当我打电话给脚本时,提示可以播放,但是它根本没有接收我的任何输入。当我讲话时,它会响应“不输入”。我是否会缺少一些指示用户输入的标签。这是网站上的示例脚本:

<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1">
   <link next="#MainMenu">
      <grammar type="text/gsl">[main back begin]</grammar>
   </link>

   <form id="MainMenu">
      <block>
         <prompt bargein="false">
            This is the Hello World Main Menu.
         </prompt>
      </block>

      <field name="MeatOrPlant">
         <prompt>
            Are you a "Carnivore" or "Vegetarian".
         </prompt>

         <grammar type="text/gsl">
            <![CDATA[[
              [vegetarian plant veggie] {<MeatOrPlant "plant">}
              [meat carnivore flesh animal] {<MeatOrPlant "meat">}
            ]]]>
         </grammar>

         <noinput>
            <prompt>
               I did not hear anything. Please try again.
            </prompt>
            <reprompt/>
         </noinput>

         <nomatch>
            <prompt>
               I did not recognize that lifestyle choice.  Please try again.
            </prompt>
            <reprompt/>
         </nomatch>

      </field>
      <filled>
         <if cond="MeatOrPlant == 'meat'">
            <goto next="#Meat"/>
            <elseif cond="MeatOrPlant == 'plant'"/>
            <goto next="#Plant"/>
         </if>
      </filled>
   </form>

   <form id="Meat">
      <field name="BackToMain">
         <prompt>
            PETA is coming for you, be afraid.
            If you wish to try again, please say Main.
         </prompt>
      </field>
      <filled>
         <!-- no way this will get hit -->
      </filled>
   </form>

   <form id="Plant">
      <field name="BackToMain">
         <prompt>
            Protein is the spawn of the devil.
            If you wish to try again, please say "Main".
         </prompt>
      </field>
      <filled>
         <!-- no way this will get hit -->
      </filled>
   </form>
</vxml>

有人知道吗? tia

有帮助吗?

解决方案

您没有提及正在使用的平台。由于您正在使用内联GSL,因此我对平台的第一个猜测是Tellme或NVP,但我认为还有其他人支持Inline GSL。

无论如何,请确保您不会遇到汇编错误。我看到一些平台只是忽略了没有编译的语法。摘要看起来正确,但是鉴于您没有使用标准语法(SRGS),我猜这是一个较旧的实现,实现越大,通常会看到的怪异和警告越多。

通常,我认为语法的语音部分没有任何错误来解释行为。虽然与您的症状无关,但您的目的地表格可能会在某些平台上引起问题,因为缺乏语法和定义的出口(您依靠默认的捕获处理程序)。为了播放信息,现场部分应该是块。请注意,如果块刚刚播放音频并退出链接语法可能会或可能不活跃(规范将暗示它们是,但是必须平台在处理和排队音频和执行识别之间进行切换。识别和连续切换进出主动语法很少见...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top