SALT: The Speech Application Markup Language
by Robert Hartman


Listing One


<HTML xmlns:salt="http://www.saltforum.org/2002/SALT">
      <HEAD>
            <TITLE>A SALT Multi-modal Example</TITLE>
            <SCRIPT language="JavaScript">
                  function ProcessInput()
                  {
                        promptWelcome.Stop();
                        listenTag.Stop();

                        switch(selectTag.value) {
                              case "prompt":
                                    divDefinition.innerText = "The prompt
element " +
                                          "is used to specify the content of
audio " +
                                          "output, either as inline or
referenced text, " +
                                          "variable values, or links to audio
files.";
                                    break;
                              case "listen":
                                    divDefinition.innerText = "The listen
element " +
                                          "is used for recognition and/or
recording, " +
                                          "and contains one or more grammars and
" +
                                          "optionally a set of bind elements to
inspect " +
                                          "and copy input.";
                                    break;
                              case "grammar":
                                    divDefinition.innerText = "The grammar
element " +
                                          "is used to specify possible user
inputs " +
                                          "with rules identified either inline
or " +
                                          "by reference.";
                                    break;
                              case "bind":
                                    divDefinition.innerText = "The bind element
" +
                                          "is used to bind values from spoken
input " +
                                          "into the page, or to call methods on
" +
                                          "page elements.";
                                    break;
                              default:
                                    divDefinition.innerText = "";
                        }
                  }
            </SCRIPT>
      </HEAD>
      <body onload="promptWelcome.Start()">
            Select a SALT tag to view its definition:<P>
            <SELECT id="selectTag" onchange="ProcessInput()">
                  <OPTION value="prompt">prompt</OPTION>
                  <OPTION value="listen">listen</OPTION>
                  <OPTION value="grammar">grammar</OPTION>
                  <OPTION value="bind">bind</OPTION>
                  <OPTION SELECTED value="">-- Select a Tag ---</OPTION>
            </SELECT>
            <P>Definition:<P>
            <DIV id="divDefinition">
            </DIV>

            <salt:prompt id="promptWelcome" oncomplete="listenTag.Start()">
                  Welcome to a SALT multi-modal sample. You may select a SALT
tag from the dropdown list either by speaking or by using a mouse.
            </salt:prompt>

            <salt:listen id="listenTag" onreco="ProcessInput()">
                  <salt:grammar src="TagGrammar.xml" />
                  <salt:bind value="//Tag" targetElement="selectTag" />
            </salt:listen>

      </body>
</HTML>




