Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Simple Prompt Example (SALT Reference; Speech Application SDK)

Simple Prompt Example

Speech Server 2004 R2
  Microsoft Speech Technologies Homepage

The following example demonstrates how to control a prompt element using its various methods.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns:salt="http://www.saltforum.org/2002/SALT">
    <object id="Speechtags" CLASSID="clsid:DCF68E5B-84A1-4047-98A4-0A72276D19CC" VIEWASTEXT></object>
    <?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.


    <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">
    <input type="button" name="BtnStop" id="StopBtn" value="Stop Prompt" onClick="StopPrompt()">
   <b> Prompt Action:</b> <input type="text" name="Status" id="ProgressTxt">
    <script language="JScript">

      var statusFlag=0;
      // 0 = Initial State
      // 1 = prompt in-progress
      // 2 = prompt paused
      function StartPrompt() {
        if (statusFlag == 0) {
          ProgressTxt.value="Prompt started...";

      function PausePrompt() {
        if (statusFlag == 1) {
          ProgressTxt.value="Prompt paused...";      

      function ResumePrompt() {
        if (statusFlag == 2) {
          ProgressTxt.value="Prompt resumed..."; 
      function StopPrompt() {
        if(statusFlag > 0) {
          ProgressTxt.value="Prompt stopped...";
          statusFlag = 0;   

See Also

prompt Element

© 2015 Microsoft