ZVON > References > VoiceXML Reference
Element:audio
Attributes: | caching | fetchhint | fetchtimeout | src |
Parents: | audio | block | catch | choice | div | emp | enumerate | error | field | filled | help | if | initial | menu | noinput | nomatch | object | prompt | pros | record | subdialog | transfer |
Children: | audio | break | div | emp | enumerate | pros | sayas | value |
Description:

Go to Standard

Examples:

Please say your city.
<audio src="say_your_city.wav"/>


<prompt bargein="false">
     <audio src="legalese.wav"/>
</prompt>


<prompt>
     <audio src="welcome.wav">
          <emp>Welcome</emp> to Voice Portal.
     </audio>
</prompt>


<choice next="http://www.stargazer.example/voice/astronews.vxml">
     <prompt>
          <audio src="http://www.stargazer.example/space.wav"> Stargazer
               <emp>astrophysics</emp> news
          </audio>
     </prompt>
</choice>


<prompt> Welcome to the Bird Seed Emporium.
     <audio src="http://www.birdsounds.example/thrush.wav"/> We have 250 kilogram drums of thistle seed for
     <sayas class="currency">$299.95</sayas> plus shipping and handling this month.
     <audio src="http://www.birdsounds.example/mourningdove.wav"/>
</prompt>


<vxml version="1.0">
     <property name="caching" value="fast"/> …
     <form id="test">
          <block>
               <audio src="http://www.weather4U.example/vxml/welcome.wav"/>
               <audio caching="safe" src="http://www.onlineads.example/weather4U/ad17"/>
          </block> …
     </form> …
</vxml>


<form name="transfer">
     <var name="mydur" expr="0"/>
     <block>
          <audio src="chopin12.wav"/>
     </block>
     <transfer name="mycall" dest="phone://18005551234" connecttimeout="30s" bridge="true">
          <filled>
               <assign name="mydur" expr="mycall$.duration"/>
               <if cond="mycall == 'busy'">
                    <prompt> Sorry, our customer support team is busy serving other customers. Please try again later. </prompt>
                    <elseif cond="mycall == 'noanswer'"/>
                    <prompt> Sorry, our customer support team's normal hours are 9 am to 7 pm Monday through Saturday. </prompt>
               </if>
          </filled>
     </transfer>
     <block>
          <submit namelist="mycall mydur" next="/cgi-bin/report"/>
     </block>
</form>


<form id="weather_info">
     <grammar src="cityandstate.gram" type="application/x-jsgf"/>
     <block>
          <prompt bargein="false"> Welcome to the weather information service.
               <audio src="http://www.online-ads.example/wis.wav"/>
          </prompt>
     </block>
     <initial name="start">
          <prompt> For what city and state would you like the weather? </prompt>
          <help> Please say the name of the city and state for which you you would like a weather report.</help>
          <noinput count="1">
               <reprompt/>
          </noinput>
          <noinput count="2">
               <reprompt/>
               <assign name="start" expr="true"/>
          </noinput>
     </initial>
     <field name="state">
          <prompt>What state?</prompt>
          <help>Please speak the state for which you want the weather.</help>
     </field>
     <field name="city">
          <prompt>Please say the city in
               <value expr="state"/> for which you want the weather.
          </prompt>
          <help>Please speak the city for which you want the weather.</help>
          <filled>
               <if cond="city == 'Los Angeles' && state == undefined">
                    <assign name="state" expr="'California'"/>
               </if>
          </filled>
     </field>
     <field name="go_ahead" type="boolean" modal="true">
          <prompt>Do you want to hear the weather for
               <value expr="city"/>,
               <value expr="state"/>?
          </prompt>
          <filled>
               <if cond="go_ahead">
                    <prompt bargein="false">
                         <audio src="http://www.online-ads.example/wis2.wav"/>
                    </prompt>
                    <submit next="/servlet/weather" namelist="city state"/>
               </if>
               <clear namelist="start city state go_ahead"/>
          </filled>
     </field>
</form>


<form id="weather_info">
     <grammar src="cityandstate.gram" type="application/x-jsgf"/>
     <block>
          <prompt bargein="false"> Welcome to the weather information service.
               <audio src="http://www.online-ads.example/wis.wav"/>
          </prompt>
     </block>
     <initial name="start">
          <prompt> For what city and state would you like the weather? </prompt>
          <help> Please say the name of the city and state for which you you would like a weather report.</help>
          <noinput count="1">
               <reprompt/>
          </noinput>
          <noinput count="2">
               <reprompt/>
               <assign name="start" expr="true"/>
          </noinput>
     </initial>
     <field name="state">
          <prompt>What state?</prompt>
          <help>Please speak the state for which you want the weather.</help>
     </field>
     <field name="city">
          <prompt>Please say the city in
               <value expr="state"/> for which you want the weather.
          </prompt>
          <help>Please speak the city for which you want the weather.</help>
          <filled>
               <if cond="city == 'Los Angeles' && state == undefined">
                    <assign name="state" expr="'California'"/>
               </if>
          </filled>
     </field>
     <field name="go_ahead" type="boolean" modal="true">
          <prompt>Do you want to hear the weather for
               <value expr="city"/>,
               <value expr="state"/>?
          </prompt>
          <filled>
               <if cond="go_ahead">
                    <prompt bargein="false">
                         <audio src="http://www.online-ads.example/wis2.wav"/>
                    </prompt>
                    <submit next="/servlet/weather" namelist="city state"/>
               </if>
               <clear namelist="start city state go_ahead"/>
          </filled>
     </field>
</form>