VoiceXML files

The central component of a voice application is the main (or root) VoiceXML file used by the Voice Browser service. The root file is simply a text file, written in the syntax described in the W3C Voice Extensible Markup Language specification. This XML document is the hub that ties all the other components of the application together.

Just as a web browser renders HTML documents visually, a VoiceXML interpreter renders VoiceXML documents audibly. As with HTML documents, VoiceXML documents have web URIs and can be located on any web server. You can also use a JavaServer page (JSP) written in ECMAScript to generate valid VoiceXML.

The VoiceXML files and JavaServer pages for PizzaTalk are located in:

$NVP_HOME/appservice/applications/webapps/PizzaTalk/dialogs/

The entry point for this application is the Welcome.vxml file:

<?xml version="1.0"?>
<!DOCTYPE vxml PUBLIC "-//Nuance/DTD VoiceXML 2.0//EN" "http://voicexml.nuance.com/dtd/nuancevoicexml-2-0.dtd">
<vxml version="2.0" application="pizza.vxml">
    <form id="Welcome">
        <block>
            <nuance:taskbegin name="sold_a_pizza"/>
            <audio expr="PromptPath + 'nuancebrand8k.wav'"/>
            <audio expr="PromptPath + 'Welcome.wav'"/>
            <audio src="pause:750"/>
            <goto next="GetPizzaSize.vxml"/>
        </block>
    </form>
</vxml>

This file first loads the pizza.vxml root application file, which sets global properties, initializes variables, and invokes grammars that interpret universal commands throughout the dialog. The Welcome.vxml file then plays the initial prompts, and transitions to the GetPizzaSize.vxml file.

Other VoiceXML files perform individual tasks within the application. Each file plays audio prompts, invokes grammars, assigns values to variables, and refers to other VoiceXML files or JavaServer pages as needed.