Hello, World.

This sample illustrates the classic "Hello, World" program in VoiceXML.

Phone applications provide two basic ways to play output to the caller:

  • Play computer synthesized speech, also called text-to-speech (TTS). TTS is the simplest form of output and is accomplished in VoiceXML by providing a text string within the audio element. When the voice application runs, the voice browser dynamically converts the text string into speech output. TTS is very useful for rapidly prototyping voice applications.
  • Play a recorded audio file. For a polished-sounding phone application like those that you'll find on 1-800-555-TELL, recorded audio files are preferred because human voice prompts give the application a more natural "sound and feel." In addition, recorded audio files are not limited to pure speech -- they can include background music, sound effects, etc.
Try It!
  1. Set your Application URL to http://studio.247-inc.net/library2/code/ex-101/index.vxml
  2. Call the number shown in VXML Tools page
  3. Sign in, and play!

The application uses the src attribute of the audio element to play recorded audio files. It also includes text within the audio element to play text-to-speech (TTS). To add a pause between audio prompts, the application uses the time attribute of the break element.

The VoiceXML code for this example follows:

<?xml version="1.0"?>
<!--
Tellme Studio Code Example 101
Copyright (C) 2002-2003 Tellme Networks, Inc. All Rights Reserved.

THIS CODE IS MADE AVAILABLE SOLELY ON AN "AS IS" BASIS, WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
WARRANTIES THAT THE CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A
PARTICULAR PURPOSE OR NON-INFRINGING.
-->

<vxml version="2.0">

   <form id="hello_form">
   <block>
      <!-- Play the audio  -->
      <audio src="hello.wav">
        <!-- TTS fallback -->
        hello world
      </audio>

      <!-- Pause for half a second -->
      <break time="500ms"/>
      
      <prompt>good bye</prompt>

      <disconnect/>
   </block>
   </form>
</vxml>


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