Share via


Pause Method

  Microsoft Speech Technologies Homepage

Pauses playback without flushing the audio buffer.

prompt.Pause()

Remarks

The Pause method is a Microsoft-specific extension to Speech Application Language Tags (SALT). The Pause method of the prompt element is not implemented for Telephony Application Services.

The Pause method has no effect if playback is currently paused or stopped. While playback is paused, subsequent calls to the Start method of either the prompt element or the PromptQueue object have the expected result of delimiting prompts that were added to subqueues. Playback remains paused until the Resume method is called.

The Pause method is a synchronous method that does not raise any events.

Example

The following code demonstrates the use of the Pause 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 buttons to pause and resume the playing of this prompt.

    </salt:prompt>

    <input type="button" name="BtnStart" value="Start Prompt" OnClick="StartPrompt()" id="StartBtn">
    <input type="button" name="BtnPause" value="Pause Prompt" OnClick="PausePrompt()" id="PauseBtn">
    <input type="button" name="BtnResume" value="Resume Prompt" OnClick="ResumePrompt()" id="ResumeBtn">

    <script language="JScript">
    <!--
      function StartPrompt() {
        Prompt1.Start();
      }
      function PausePrompt() {
        Prompt1.Pause();
      }
      function ResumePrompt() {
        Prompt1.Resume();
      }
    -->
    </script>
  </body>
</html>

See Also

prompt Element |  PromptQueue Object | Start Method | Stop Method | Resume Method