Larson Technical Services: Voice Technology Consulting

Exercise 13.3

Write two multimodal versions of Exercise 5.2

A.Write a multimodal dialog scenario for a “point and speak” dialog (Use notation similar to Figure 13.4.)

Step Prompt to User User Response
Spoken Displayed Spoken Keyboard/Mouse
1 Points to date field
2 Date field highlighted December 18, 2002
3 December 18, 2002 in date field Points to time field
4 Time field highlighted Three thirty PM
5 3:30 pm in time filed

B. Write extended VoiceXML code for a “point and speak” dialog.


<form name= "date_time">
   <all-of>
      <field name = "date" > 
           <grammar>
           <prompt><media type = "display"> date </media></prompt>
               <one-of>
                     <mode = "voice" src = "date.grammar"/>
                     <mode = "handwriting" src = "date.grammar"/>
               </one-of>
            </grammar>
      </field>

      <field name = "time" > 
           <prompt><media type = "display"> time </media></prompt>
           <grammar>
               <one-of>
                     <mode = "voice" src = "time.grammar"/>
                     <mode = "handwriting" src = "time.grammar"/>
               </one-of>
            </grammar>
      </field>
   <all-of>
</form> 

C. Write HTML plus SALT code for a “point and speak” dialog.


<body>

     <form id="Date"     
          method="post"    
          action="cgi/name.pl">      

     <input name="txtDate" 
            type="text" ev:event="onfocus" 
            ev:handler="#Date"/> 

      <!-- Declare xhtml script handlers for setting inputs -->      

     <script ev:target="#Date" 
           ev:event="vxml:filled"> 
                 txtDate = voiceDate;      
      </script> 

       <!-- done xhtml script handlers -->       

      <input type="submit" 
           value="Submit"/>     
        <input type="reset"/>   
     </form>  
</body>   

<!--- declare the voice handlers. -->    

<vxml:form id="voiceDate">      
   <vxml:field name="Date">        
     <vxml:grammar src="date.srgf" 
              type="application/x-srgf"/>        
     <vxml:prompt id="Dagte"> 
            Your name.        
     </vxml:prompt>      
   </vxml:field>    
</vxml:form> 
<!-- done voice handlers. --> 

D. Compare the two versions with respect to programming style and lines of code required.

Extended VoiceXML is declarative code, while HTML plus SALT is event driven procedural code.

Return to the Instructor’s Page

Comments are off for this post