dcsimg
March 23, 2017
Hot Topics:

SALT (Part II): Elements of SALT

  • October 1, 2002
  • By Hitesh Seth
  • Send Email »
  • More Articles »

<record>

The <record> element is used within <listen> elements (described later) for speech recording. One <listen> can have only <record> element.

Syntax:
    <record type="" beep=""/>

Examples:
   
Examples of the <record> element are illustrated with the examples of the <listen> element.

<bind>

The <bind> element is used within <listen> elements (described later) for processing results from speech recording or speech recognition.

Syntax:
    <bind targetelement="" targetattribute="" test="" value=""/>

Examples:
Examples of the <bind> element are illustrated with the examples of <listen> element.

<listen>

The <listen> element is used for speech recognition and/or audio recording. When it is used for speech recognition, the element itself contains <grammar> elements which identify the various alternative inputs that the platform must recognize. Similarly, when the element is used for speech recording it contains a <record> element to manage the recoding process. Once the results have been obtained, a <bind> element can be used to process the results.

Syntax:
    <listen id="" initialtimeout="" babbletimeout="" maxtimeout="" endsilence="" reject="" xml:lang="" mode="">
        --- content of listen (record/grammar & bind) ---
    </listen>

When <listen> is used for speech recognition, Start(), Stop() and Activate() methods are used for starting, stopping and activating the grammars respectively. However, when used for speech recording, Start() and Stop() are used for starting/stopping the recording process.

Examples:

  1. Using the <listen> element for Speech Recognition. The grammar is specified by the external URL Employee.grxml, and once recognized the "//employee_name" is binded to the input element 'txtName".
    <listen id="listenEmployeeName">
         <grammar src="MyGrammar.grxml"/>
         <bind targetelement="txtName" value="//employee_name"/>
    </listen>
  2. Using the <listen> element for Speech Recognition. The grammar is specified by the external URL Employee.grxml, and once recognized the function processEmployeeName() is called which assigns values to the proper fields.
    <listen id="listenEmployeeName" onreco="processEmployeeName">
         <grammar src="MyGrammar.grxml"/>
    </listen>
    <script><!CDATA[
        function processEmployeeName() {
            ......;
        }
    </script>
  3. Using <listen> for voice recording:
    <listen id="recordMessage" onreco="processMessage">
        <record beep="true"/>
         
    </listen>
    <script><!CDATA[
        function processMessage() {
            ......;
        }
    </script>

<dtmf>

The <dtmf> element is used in telephony applications for recognizing DTMF (Dual Tone Multi-Frequency) inputs (inputs from a touch tone keypad). The usage is very similar to that of the <listen> element (when it is used for recognition).

Syntax:
    <dtmf id="" initialtimeout="" interdigittimeout="" endsilence="" preflush="">
        --- content of ---
    </dtmf>

Start() and Stop() methods are used on-top of DTMF objects to start and stop the DTMF collection process. Once DTMF recognition is complete the event onreco is fired.

Examples:

  1. <dtmf id="dtmfPIN">
        <grammar src="PIN_Grammar.grxml"/>
        <bind value="//pin" targetelement="txtPIN"/>
    </dtmf>
  2. <dtmf id="dtmfPIN" onreco="processPIN">
        <grammar src="PIN_Grammar.grxml"/>
    </dtmf>
    <script><!CDATA[
        function processPIN() {
            ......;
        }
    </script>

<smex>

The <smex> element, which stands for Simple Message Extension, communicates with platform specific functionality such as logging/telephony call control, etc. It is also a means by which SALT platform implementations can introduce new (however, platform-specific) functionality that is not included in the current SALT Specification as well. <smex> element may have <bind>, <param> as its child elements.

Syntax:
    <smex id="" sent="" timer="">
        --- smex content---
    </smex>

The onreceive() event is fired once the SALT Browser receives a platform message.

To be Continued

We will continue our exploration of SALT in the next article by previewing Microsoft .NET Speech SDK--a toolkit that is focused around building dynamic speech applications using SALT.

Resources

About Hitesh Seth

A freelance author and known speaker, Hitesh is a columnist on VoiceXML technology in XML Journal and regularly writes for other technology publications including Java Developer’s Journal, Web Services Journal and The Computer Bulletin on emerging technology topics such as J2EE, Microsoft .NET, XML, Wireless Computing, Speech Applications, Web Services & Enterprise/B2B Integration. He is the conference chair for VoiceXML Planet Conference & Expo. Hitesh received his Bachelors Degree from the Indian Institute of Technology Kanpur (IITK), India. Feel free to email any comments or suggestions about the articles featured in this column at hks@hiteshseth.com.





Page 2 of 2



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date
Rocket Fuel