break element
VoiceXML 2.0
Introduces a specified amount of silence into the audio played back to the user.


size = "string"
sizeexpr = "ECMAScript_Expression"
time = "string"
timeexpr = "ECMAScript_Expression"

One of the following values:
none Indicates no pause.
small Indicates a 200ms pause.
medium Indicates a 500ms pause.
large Indicates a 1000ms pause.
An ECMAScript expression that evaluates to one of the valid values of the size attribute. This attribute is a Tellme extension.
The duration of the pause in seconds (s) or milliseconds (ms), such as "2s", "500ms", or "1.5s." If the units are not specified, the VoiceXML interpreter assumes milliseconds.
An ECMAScript expression that evaluates to a duration equivalent to the time attribute. This attribute is a Tellme extension.



The break element introduces a pause of n seconds (s) or milliseconds (ms). Use it within prompt element text so that audio sounds more natural.
The size, time, sizeexpr and timeexpr attributes are mutually exclusive.

In the following example, the caller hears, "Good morning! (1.5 second pause) Welcome to (.5 second pause) News of the Day. (.5 second pause) Tellme! ..."

<?xml version="1.0"?>
<vxml version="2.1"
      Good morning!
      <break time="1.5s"/>    
      Welcome to 
      <break time="500"/>    
      News of the Day
      <break size="medium"/>

The following example plays a list of subjects generated from script. The foreach element iterates through the ECMAScript array of hashes to play back the name of the subject. In addition, the break element is used to pause between subjects. The pause value is included in the ECMAScript hash.

<?xml version="1.0"?>
<vxml version="2.1"

   <var name="sAudioBase" expr="'audio/tmu/'"/>
   <var name="sSubjectsBase" expr="sAudioBase + 'subjects/'"/>


   // array of subjects for tts
   var aSubjects = ["", "overview", "design", "audio", "development", "tuning"];

   // array of prompt triplets (wav, tts, pause)
   var aPrompts = [
      {"wav" : sAudioBase + "org.wav", "tts" : 
            "The Tellme University classes are grouped by subject." +
            "When you hear the subject you want, just say it to hear the classes offered.", 
            "pause" : "300ms"},
      {"wav" : sSubjectsBase + "sn1c.wav", "tts" : "overview", "pause" : "500ms"},
      {"wav" : sSubjectsBase + "sn2c.wav", "tts" : "design", "pause" : "500ms"},
      {"wav" : sSubjectsBase + "sn3c.wav", "tts" : "audio", "pause" : "500ms"},
      {"wav" : sSubjectsBase + "sn4c.wav", "tts" : "development", "pause" : "500ms"},
      {"wav" : sSubjectsBase + "sn5c.wav", "tts" : "tuning", "pause" : "500ms"}      


   <form id="list_subjects">

   <field name="subject_id">
         <!-- iterate through each triplet -->
         <foreach item="oPrompt" array="aPrompts">
            <audio expr="oPrompt.wav">
              <value expr="oPrompt.tts"/>
            <break timeexpr="oPrompt.pause"/>
         <!-- only play the first prompt (org) once -->

      <grammar src="subjects-voice.grxml" mode="voice" type="application/srgs+xml"/>

         <goto next="#query_repeat_list"/>

         I'm sorry. I didn't get that. 
         Please say one of the following subjects.

         You picked
         <!-- the grammar return value is the subject id -->
         <!-- construct the path to the subject and index into the tts array -->
         <audio expr="sSubjectsBase + 'sn' + subject_id + 'c.wav'">
            <value expr="aSubjects[subject_id]"/>
         <exit />


   <form id="query_repeat_list">
      <field name="yesno" type="boolean">
         <prompt>Do you want to hear this list again?</prompt>
         <catch event="noinput nomatch">
            Sorry. I didn't get that. 
            Please say yes to hear the list again. 
            Say no to return to the main menu
            <if cond="yesno">
               <goto next="#list_subjects"/>


[24]7 Inc.| Terms of Service| Privacy Policy| General Disclaimers