VXML & CCXML

VoiceXML Tutorials

VoiceXML (VXML) is the W3C's standard XML format for specifying interactive voice dialogues between a human and a computer. It allows voice applications to be developed and deployed in an analogous way to HTML for visual applications. Just as HTML documents are interpreted by a visual web browser, VoiceXML documents are interpreted by a voice browser. A common architecture is to deploy banks of voice browsers attached to the Public Switched Telephone Network (PSTN) to allow users to interact with voice applications over the telephone.

Reference Website : http://www.vxml.org/, http://en.wikipedia.org/wiki/VoiceXML, http://cafe.bevocal.com/docs/tutorial/tutorial.pdf etc.

Lets start

The famous Hello World Application

Via text to speach

<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1" >

<form>

<block>

<prompt>

Hello World. This is my VXML application.

</prompt>

</block>

</form>

Via voice file

<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1" >

<form>

<block>

<prompt>

<audio src = "../prompts/searchtopic.wav"></audio>

</prompt>

</block>

</form>

A small program to select and play your favorite song. I have used abnf as grammar file.

selectsong.vxml

<vxml version="2.0" xml:lang="hi-IN" xmlns="http://www.w3.org/2001/vxml">

<property name="confidencelevel" value="0.4"/>

<property name="termchar" value=""/>

<var name="song" expr="'Default.wav'"/>

<form id="play">

<field name="userOption" slot = "tp">

<prompt>

<audio src = "../prompts/selectyoursong.wav"></audio>

</prompt>

<grammar src="songselect.abnf" type="application/grammar+xml"/>

<filled>

<assign name="userOption" expr="userOption"/>

<if cond="userOption=='BryanAdams'">

<assign name="song" expr="summerof69"/>

<goto next="#playfile"/>

<elseif cond="userOption=='Michale'"/>

<assign name="song" expr="justbeatit"/>

<goto next="#playfile"/>

<elseif cond="userOption=='Enrique'"/>

<assign name="song" expr="Hero"/>

<goto next="#playfile"/>

<elseif cond="userOption=='Eagles'"/>

<assign name="song" expr="HotelCalifornia"/>

<goto next="#playfile"/>

</if>

</filled>

<noinput>

<audio src = "../prompts/noinput.wav">

</audio>

<reprompt/>

</noinput>

<nomatch >

<audio src = "../prompts/idontknowwhatyousaid.wav">

</audio>

<reprompt/>

</nomatch>

</field>

</form>

<form id="playfile">

<block>

<prompt>

<audio src = "../prompts/+ song +'.wav"></audio>

</prompt>

</block>

songselect.abnf

</form>

</vxml>

#ABNF 1.0 UTF-8;

// comment -- using UTF-8

language en-IN;

mode voice;

tag-format <semantics/1.0>;

root $main;

public $main = $list {out.expert=rules.latest();};

$list

= ("bryan" | "adams" | "bryan adams") {out="BryanAdams";}

|("Eagles"| "Hotel" | "Hotel California") {out="Eagles";}

|("Michale"|"Jackson"|"Michale Jackson"|"Just Beat It") {out="Michale";}

|("Enrique"|"iglesias" | "Enrique iglesias" | "Hero") {out="Enrique";}

;