Share via


multicolor Attribute

  Microsoft Speech Technologies Homepage

Specifies whether the audiometer element appears in multicolor. Optional.

<audiometer multicolor="hVal" multicolor=yVal />

Remarks

The audiometer element is a Microsoft-specific extension to Speech Application Language Tags (SALT). Consequently, it has its own namespace that must be included in order to enable functionality of the audiometer element. The namespace declaration is:

<html xmlns:multimodal="https://schemas.microsoft.com/speech/2002/12/salt/multimodal"/>

In addition, the following statement must also be included in the body to ensure property operation.

<?import namespace="multimodal" implementation="#SpeechTags" />

The multicolor attribute is a Boolean value that is true if the audiometer element will display with a multicolor appearance, and false if it will not. The default value is true.

When the multicolor attribute is true, the audiometer element displays yellow for the upper volume range and red for the top of the volume range. Setting the multicolor attribute to false causes the audiometer element to appear in monochrome blue-grey, which is more suitable for monochrome and grey scale display.

Example

The following code demonstrates the use of the multicolor attribute.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns:multimodal="https://schemas.microsoft.com/speech/2002/12/salt/multimodal"
xmlns:salt="http://www.saltforum.org/2002/SALT"  >
  <head>
    <title>Audiometer Example</title>
  </head>
  <body onload="Prompt1.Start()">
    <!-- declare the object on the page-->
    <object id="SpeechTags" CLASSID="clsid:DCF68E5B-84A1-4047-98A4-0A72276D19CC" VIEWASTEXT></object>    
    <?import namespace="salt" implementation="#SpeechTags" />
    <?import namespace="multimodal" implementation="#SpeechTags" />
    
    <salt:prompt id="Prompt1">
      Please speak the name of a major US city after clicking the Start button.
    </salt:prompt>

    
    <salt:listen id="listen1" mode="automatic"  onreco="Handleonreco()" onnoreco="Handleonnoreco()" 
    onsilence="Handleonsilence()" onerror="Handleonerror()" onbabbletimeout="Handleonerror()">
      <multimodal:audiometer id="audiometerTag" multicolor="false" targetelement="txtComments"
      targetlocation="right" height="20" width="50"/>
      <salt:grammar name="cities"> 
        <grammar version="1.0" tag-format="semantics-ms/1.0" root="cities" 
        lang="en-US" xmlns="http://www.w3.org/2001/06/grammar">
          <rule id="cities">
            <one-of>
              <item>Atlanta</item>
              <item>Baltimore</item>
              <item>Boston</item>
              <item>Chicago</item>
              <item>Dallas</item>
              <item>Denver</item>
              <item>Detroit</item>
              <item>Houston</item>
              <item>Las Vegas</item>
              <item>Los Angeles</item>
              <item>Miami</item>
              <item>Minneapolis</item>
              <item>New York City</item>
              <item>Philadelphia</item>
              <item>Pittsburgh</item>
              <item>Reno</item>
              <item>Salt Lake City</item>
              <item>San Francisco</item>
              <item>Seattle</item>
              <item>Washington, DC</item>
            </one-of>
          </rule>
        </grammar>
      </salt:grammar>
      <salt:bind targetelement="boxReco" targetattribute="value" value="//cities"/>
    </salt:listen>
    
    <table cellspacing="0" cellpadding="0" cols=2>
      <tr>
        <td>Recognition Status:</td> 
        <td><input type="text" size="40" name="boxStatus" value="(recognition status goes here)"
        id="boxStatus"/></td>
      </tr>
      <tr>
        <td>Recognition Text:</td> 
        <td><input type="text" size="40" name="boxReco" value="(recognition text goes here)"
        id="boxReco"/></td>
      </tr>
    </table>      

    <br>
    Semantic Markup Language (SML) Result:<br>
    <TEXTAREA cols="60" rows="5" ID=txtComments>(Semantic Markup Language (SML) results are displayed here)
    </TEXTAREA>
    <p>
     <input type="button" name="BtnStart" value="Start" onmousedown="Start()"  id="BtnStart"/>    
       
    <script language="JScript">
    <!--
      function Start() {
        boxStatus.value = "(Listening...)";
        boxReco.value = "(Waiting response)";
        txtComments.value = "(Waiting response)";
        listen1.Start();
      }

      function Stop() {
        listen1.Stop();
        boxStatus.value = listen1.status;
        boxReco.value = event.srcElement.text;
      }

      function Handleonreco() {
        listen1.Stop();
        boxStatus.value = listen1.status;
        boxReco.value = event.srcElement.text;
        txtComments.value = event.srcElement.recoresult.xml
      }

      function Handleonnoreco() {
        boxStatus.value = "onnoreco fired " + listen1.status;
        boxReco.value = ""
        txtComments.value = "";
      }

      function Handleonsilence() {
        boxStatus.value = "onsilence fired " + listen1.status;
        boxReco.value = ""
        txtComments.value = "";
      }

      function Handleonerror() {
        boxStatus.value = "onerror fired " + listen1.status;
        boxReco.value = "";
        txtComments.value = "";
      }
    -->  
    </script>
  </body>
</html>

See Also

audiometer Element