Share via


beep Attribute

  Microsoft Speech Technologies Homepage

Specifies whether a beep is heard before recognition begins. Optional.

<listen beep=boolVal />

Remarks

The beep attribute is true if a beep is to be heard before recognition begins, and false if it is not.

Example

The following code demonstrates the use of the beep attribute.

<html xmlns:salt="http://www.saltforum.org/2002/SALT">
  <head>
    <object id="Speechtags" CLASSID="clsid:DCF68E5B-84A1-4047-98A4-0A72276D19CC" VIEWASTEXT></object> 
  </head>
  <body onload="RunAsk()">
    <?import namespace="salt" implementation="#SpeechTags" />
    <form id="f1" action="http://www.woodgrovebank.com/savewaveform.aspx" method="get">
      <input name="vmail" type="hidden" />
    </form>
    
    <table cellspacing="0" cols="2">
      <tr>
        <td>Recording duration:</td>
        <td><input id="iptRecDur" type="text"  size="50"></td>
      </tr>
      <tr>
        <td>Recording location:</td>
        <td><input id="iptRecLoc" type="text" size="50"></td>
      </tr>
      <tr>
        <td>Recording size:</td>
        <td><input id="iptRecSize" type="text" size="50"></td>
      </tr>
      <tr>
        <td>Recording type:</td>
        <td><input id="iptRecType" type="text" size="50" ></td>
      </tr>
</table>

    <salt:prompt id="p_record" oncomplete="l_recordvm.Start()">
      Please speak after the tone. You may press any key to end your recording.
    </salt:prompt>
    <salt:prompt id="p_save">
      Do you want to save this recording?
    </salt:prompt>

    <!-- Recording session - max 60 seconds recording -->
    <salt:listen id="l_recordvm" initialtimeout="3000" endsilence="1500" babbletimeout="60000"
     onreco="saveAudio()" onnoreco="saveAudio()" onsilence="RunAsk()" >
      <salt:record type="audio//x-wav" />
    </salt:listen>

    <!-- listen for capturing whether user wants to save voice mail -->
    <salt:listen beep="true" id="l_save" onreco="processSave()">
      <salt:grammar name="yesno"> 
        <grammar version="1.0" tag-format="semantics-ms/1.0" lang="en-US" 
        xmlns="http://www.w3.org/2001/06/grammar" root="root">
          <rule id="root">
            <ruleref uri="#yesno" />
          </rule>
          <rule id="yesno">
            <one-of>
              <item>Yes</item> 
              <item>No</item> 
            </one-of>
          </rule>
        </grammar>
      </salt:grammar>
    </salt:listen>      
      
    <script language="JScript">
    <!--
      function RunAsk() {
        p_record.Start();
      }
      // Ask user if they are satisfied with their recording
      function saveAudio () {
        showRecDetails();
        p_save.Start();
        l_save.Start();
      }
      // If user is satisfied post file name back to web server
      // otherwise start again
      function processSave () {
        smlResult = event.srcElement.recoresult;
        saidText = smlResult.selectSingleNode("/").text;
        if (saidText == "Yes") {
          alert("Recording has been saved at " + l_recordvm.recordlocation);
        } else {
          alert("Recording will not be saved.");
        RunAsk();
        }
      }

      function showRecDetails() {
        iptRecDur.value=l_recordvm.recordduration + " milliseconds";
        iptRecLoc.value=l_recordvm.recordlocation;
        iptRecSize.value=l_recordvm.recordsize + " bytes";  
        iptRecType.value=l_recordvm.recordtype;
      }
    -->  
    </script>
  </body>
</html>

See Also

listen Element