1 / 85

Student Pages

Student Pages. http://www.clsp.jhu.edu/~anni/roster.html. Last Time: HTML Forms and Javascript If you haven’t finished the survey assignment, email us or come to office hours. 2/14: Programming Phones. This script says “hello world”. <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml">

huey
Download Presentation

Student Pages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Student Pages http://www.clsp.jhu.edu/~anni/roster.html

  2. Last Time: HTML Forms and JavascriptIf you haven’t finished the survey assignment, email us or come to office hours

  3. 2/14: Programming Phones

  4. This script says “hello world” <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <exit/> </block> </form> </vxml>

  5. This script says “hello world” <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <exit/> </block> </form> </vxml> Call 877-500-VXML and use my developer ID (540460366) and pin (0123) to preview it When you’re done, put this text into your Scratchpad and call VXML again and use your developer ID and pin to preview your own code

  6. Prerequisite: XML

  7. XML Disclaimer: This is an introduction to how an XML format works in general, this is not the particular syntax of a VoiceXML program or any other specific XML format

  8. XML Opening and closing tags <myTellmeProgram> </myTellmeProgram>

  9. XML Nested hierarchy of tags <myTellmeProgram> <introduction> <welcome>Hello World</welcome> <welcome>Hi, What’s up?</welcome> </introduction> <mainSection> … </mainSection> </myTellmeProgram>

  10. XML Nested hierarchy of tags <myTellmeProgram> <introduction> <welcome>Hello World</welcome> <welcome>Hi, What’s up?</welcome> </introduction> <mainSection> … </mainSection> </myTellmeProgram> Level 1 (Document Root)

  11. XML Nested hierarchy of tags <myTellmeProgram> <introduction> <welcome>Hello World</welcome> <welcome>Hi, What’s up?</welcome> </introduction> <mainSection> … </mainSection> </myTellmeProgram> Level 1 (Document Root) Level 2

  12. XML Nested hierarchy of tags <myTellmeProgram> <introduction> <welcome>Hello World</welcome> <welcome>Hi, What’s up?</welcome> </introduction> <mainSection> … </mainSection> </myTellmeProgram> Level 1 (Document Root) Level 2 Level 3

  13. XML Tag Attributes <myTellmeProgram> <introduction> <welcome type=“veryFirst”>Hello World</welcome> <welcome type=“casual”>Hi, What’s up?</welcome> </introduction> <mainSection> … </mainSection> </myTellmeProgram> Attribute Value

  14. XML Comments <myTellmeProgram> <!-- this is the beginning of the introduction --> <introduction> <welcome type=“veryFirst”>Hello World</welcome> <welcome type=“casual”>Hi, What’s up?</welcome> </introduction> <mainSection> … </mainSection> </myTellmeProgram>

  15. VoiceXML (Programming Phones)

  16. This script says “hello world” <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <exit/> </block> </form> </vxml>

  17. VoiceXML (Programming Phones) <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> </vxml>

  18. VoiceXML (Programming Phones) <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> </form> </vxml>

  19. VoiceXML (Programming Phones) <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field> </field> </form> </vxml>

  20. VoiceXML (Programming Phones) <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> </block> </form> </vxml>

  21. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <exit/> </block> </form> </vxml> Audio (“Text to Speech”) Exit the application

  22. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <exit/> </block> </form> </vxml> Note beginning and end tags

  23. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <exit/> </block> </form> </vxml> This should be what’s in your Scratchpad now

  24. Back to Javascript Just like you can embed Javascript into HTML, you can embed Javascript into VoiceXML https://studio.tellme.com/vxml2/ovw/javascript.html

  25. Back to Javascript Just like you can embed Javascript into HTML, you can embed Javascript into VoiceXML https://studio.tellme.com/vxml2/ovw/javascript.html But we won’t do that in this class…

  26. VoiceXML: <goto> tag <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <goto next=“#secondGreeting”/> </block> </form> </vxml>

  27. VoiceXML: <goto> tag <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <goto next=“#secondGreeting”/> </block> </form> </vxml> Tag

  28. VoiceXML: <goto> tag <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <goto next=“#secondGreeting”/> </block> </form> </vxml> Tag Attribute

  29. VoiceXML: <goto> tag <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <goto next=“#secondGreeting”/> </block> </form> </vxml> Tag Attribute Value: Name of another form

  30. VoiceXML: <goto> tag <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <goto next=“#secondGreeting”/> </block> </form> <form id=“secondGreeting”> <block> I found my second form. <exit/> </block> </form> </vxml>

  31. VoiceXML: <goto> tag <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <goto next=“#secondGreeting”/> </block> </form> <form id=“secondGreeting”> <block> I found my second form. <exit/> </block> </form> </vxml> Attribute

  32. VoiceXML: <goto> tag <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <goto next=“#secondGreeting”/> </block> </form> <form id=“secondGreeting”> <block> I found my second form. <exit/> </block> </form> </vxml> Value Attribute

  33. VoiceXML: <goto> tag <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! <goto next=“#secondGreeting”/> </block> </form> <form id=“secondGreeting”> <block> I found my second form. <exit/> </block> </form> </vxml> Sounds like…: “Hello World I found my second form.”

  34. Try this in your Scratchpad <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <block> Hello World! This dialogue goes on <goto next=“#secondGreeting”/> </block> </form> <form id=“secondGreeting”> <block> and on <goto next=“#secondGreeting”/> </block> </form> </vxml> 1. Guess what this script will do. 2. Edit Scratchpad 3. Call 1-877-500-8965

  35. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field> </field> </form> </vxml>

  36. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers”> </field> </form> </vxml>

  37. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers”> </field> </form> </vxml> Attribute

  38. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers”> </field> </form> </vxml> Value Attribute

  39. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers” type=“boolean”> </field> </form> </vxml> Value Attribute

  40. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers” type=“boolean”> <prompt> Do you like computers? </prompt> </field> </form> </vxml> New “prompt” tag: child of “field”

  41. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers” type=“boolean”> <prompt> Do you like computers? </prompt> </field> </form> </vxml> Text to Speech: “Do you like computers?”

  42. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers” type=“boolean”> <prompt> Do you like computers? </prompt> <filled> </filled> </field> </form> </vxml> New “filled” tag: child of “field”

  43. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers” type=“boolean”> <prompt> Do you like computers? </prompt> <filled> Great, I got your answer. </filled> </field> </form> </vxml> Text to Speech: “Great, I got your answer”

  44. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers” type=“boolean”> <prompt> Do you like computers? </prompt> <filled> Great, I got your answer. </filled> </field> </form> </vxml> Broken!

  45. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers” type=“boolean”> <prompt> Do you like computers? </prompt> <filled> Great, I heard your answer. </filled> </field> </form> </vxml> Broken!

  46. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers” type=“boolean”> <prompt> Do you like computers? </prompt> <filled> Great, I got your answer. </filled> </field> </form> </vxml> Broken!

  47. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers”> <prompt> Do you like computers? </prompt> <filled> Great, I got your answer. </filled> </field> </form> </vxml> Since the predefined boolean grammar isn’t working, we’ll add one ourselves

  48. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers”> <prompt> Do you like computers? </prompt> <grammar mode="dtmf" root="top” version="1.0" tag-format="semantics/1.0" type="application/srgs+xml"> <rule id="top"> <one-of> <item>1</item> <item>2</item> </one-of> </rule> </grammar> <filled> Great, I got your answer. </filled> </field> </form> </vxml> Press 1 or 2, record the answer Copy and paste this to receive any “1 or 2” input

  49. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers”> <prompt> Do you like computers? </prompt> <grammar mode="dtmf" root="top” version="1.0" tag-format="semantics/1.0" type="application/srgs+xml"> <rule id="top"> <one-of> <item>1</item> <item>2</item> </one-of> </rule> </grammar> <filled> Great, I got your answer. </filled> </field> </form> </vxml>

  50. VoiceXML: Form Blocks <vxml version="2.1” xmlns="http://www.w3.org/2001/vxml"> <form> <field name=“likeComputers”> <prompt> Do you like computers? </prompt> <grammar mode="dtmf" root="top” version="1.0" tag-format="semantics/1.0" type="application/srgs+xml"> <rule id="top"> <one-of> <item>1</item> <item>2</item> </one-of> </rule> </grammar> <filled> Great, I got your answer. </filled> </field> </form> </vxml> Input type will be a touch tone keyboard

More Related