Last reviewed: 3/23/2024 11:42:25 AM

Validating and Interpreting VoiceXML

The VoiceXMLKit conversation management class is designed to provide you a lot of flexiblity and minimize the programming necessary to validate and interpret VoiceXML.

To validate a VoiceXML document, use the CompileDocument method. The CompileDocument method performs an XML syntax analysis with the VoiceXML grammar specification.

To run a VoiceXML document, use the OpenSession method to create a session. The OpenSession method initiates the session with the ChantXM VoiceXML interpreter.

Use the RunDocument method to interpret the VoiceXML document.

To know when the conversation has ended and obtain the and conversation data, you need to use the register the applicable callback methods for example to recieve notification when the conversation is over and data is available.

To stop the VoiceXML application, use the StopDocument method.


// Validate document
_VoiceXML.CompileDocument("mydocument.vxml"); 
...
// Interpret the document
_VoiceXML.RunDocument("mydocument.vxml", "Microsoft David Desktop - English (United States)", "Microsoft Speech Recognizer 8.0 for Windows (English - US)");
...
// To stop document run before completion, use session id returned on DlgCreateDialog event
_VoiceXML.StopDocument(_SessionID);
    

// Validate document
_VoiceXML->CompileDocument(L"mydocument.vxml");
...
// Interpret the document
_VoiceXML->RunDocument(L"mydocument.vxml", L"Microsoft David Desktop - English (United States)", L"Microsoft Speech Recognizer 8.0 for Windows (English - US)");
...
// To stop document run before completion, use session id returned on DlgCreateDialog event
_VoiceXML->StopDocument(_SessionID);
    

// Validate document
_SessionID = _VoiceXML->CompileDocument("mydocument.vxml");
...
// Interpret the document
_VoiceXML->RunDocument("mydocument.vxml", "Microsoft David Desktop - English (United States)", "Microsoft Speech Recognizer 8.0 for Windows (English - US)");
...
// To stop document run before completion, use session id returned on DlgCreateDialog event
_VoiceXML->StopDocument(_SessionID);
    

// Validate document
_VoiceXML.CompileDocument('mydocument.vxml');
...
// Interpret the document
_VoiceXML.RunDocument('mydocument.vxml', 'Microsoft David Desktop - English (United States)', 'Microsoft Speech Recognizer 8.0 for Windows (English - US)');
...
// To stop document run before completion, use session id returned on DlgCreateDialog event
_VoiceXML.StopDocument(_SessionID);
    

// Validate document
_VoiceXML.compileDocument("mydocument.vxml");
...
// Interpret the document
_VoiceXML.runDocument("mydocument.vxml", "Microsoft David Desktop - English (United States)", "Microsoft Speech Recognizer 8.0 for Windows (English - US)");
...
// To stop document run before completion, use session id returned on DlgCreateDialog event
_VoiceXML.stopDocument(_SessionID);
    

' Validate document
_VoiceXML.CompileDocument("mydocument.vxml")
...
' Interpret the document
_VoiceXML.RunDocument("mydocument.vxml", "Microsoft David Desktop - English (United States)", "Microsoft Speech Recognizer 8.0 for Windows (English - US)")
...
' To stop document run before completion, use session id returned on DlgCreateDialog event
_VoiceXML.StopDocument(_SessionID);