Share via


onempty Event

  Microsoft Speech Technologies Homepage

Occurs when the last prompt in a subqueue finishes playback.

HTML <PromptQueue.onempty="eventHandler()">
JScript PromptQueue.onempty = eventHandler;
Named Script <SCRIPT FOR = PromptQueue EVENT = onempty>

Remarks

The onempty event occurs when the oncomplete event occurs in the last prompt of the current prompt subqueue. As a result, the onempty event only occurs when the playback of the prompt subqueue completes normally without any explicit calls to the Stop method.

Although the event handler does not receive properties directly, the handler can query the event object for data.

Example

The following example demonstrates the onempty event.

PromptQueue.onempty = OnPromptQueueEmpty();
PromptQueue.onerror = OnPromptQueueError();
StartPromptQueue();
            
function OnPromptQueueEmpty() {
  LogMessage("INFORMATIONAL", "PromptQueue playback has completed, the status is: " + PromptQueue.status);
}
            
function OnPromptQueueError() {   
  LogMessage("ERROR", "A PromptQueue error has occurred, the status is: " + PromptQueue.status);
} 
function StartPromptQueue() {
  MyPrompt.Queue("This text is queued first.");
  MyPrompt.Queue("This text is queued second.");
  MyPrompt.Queue("This text is queued third.");
  PromptQueue.Start();
}

See Also

PromptQueue Object |  oncomplete Event  | prompt Element |  Stop Method