Share via


Flush Method

  Microsoft Speech Technologies Homepage

Flushes the current subqueue buffer.

PromptQueue.Flush()

Remarks

The Flush method stops playback and flushes the audio buffer. All subqueues are removed from the PromptQueue object. If playback is not in progress, the Flush method flushes all prompt subqueues. In telephony scenarios, the Flush method is executed automatically when a disconnect occurs, and the onerror event is initiated.

Example

The following code demonstrates the use of the Flush method.

function DemoFlush()            {    
  LogMessage("INFORMATIONAL", "Loading the PromptQueue.");
  MyPrompt.Queue("This text is queued first.");
  MyPrompt.Queue("This text is queued second.");
  MyPrompt.Queue("This text is queued third.");
  LogMessage("INFORMATIONAL", "Flushing the PromptQueue.");
  PromptQueue.Flush();
  MyPrompt.Queue("This should be the only prompt played.");
  fnOutput("Starting the PQ.");
  PromptQueue.Start();
}

See Also

PromptQueue Object |  prompt Element | onerror Event