Partilhar via


Stop Method

  Microsoft Speech Technologies Homepage

Stops playback and flushes the current subqueue from the audio buffer.

prompt.Stop()

Remarks

When playback is stopped using the Stop method, the oncomplete event is not raised. If playback has already stopped, the Stop method flushes the current subqueue from the audio buffer.

The Stop method of the prompt element is not implemented for Telephony Application Services.

Example

The following code demonstrates the use of the Stop method.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns:salt="http://www.saltforum.org/2002/SALT">
  <head>
    <object id="Speechtags" CLASSID="clsid:DCF68E5B-84A1-4047-98A4-0A72276D19CC" VIEWASTEXT></object>
  </head>
   
  <body>
    <?import namespace="salt" implementation="#Speechtags" />
    <salt:prompt id="Prompt1" >
      This is a very long prompt. While this prompt is playing, please
      click the Stop Prompt button to stop the playing of this prompt.

    </salt:prompt>
    
    <input type="button" name="BtnStart" value="Start Prompt" OnClick="StartPlayback()" id="StartBtn">
    
    <br><br>
    <input type="button" name="BtnStop" value="Stop Prompt" OnClick="StopPlayback()" id="StopBtn">

    <script language="JScript">
    <!--
      function StartPlayback() {
        Prompt1.Start();
      }
        
      function StopPlayback() {
        Prompt1.Stop();
      }
    -->
    </script>
  </body>
</html>

See Also

prompt Element | Start Method