status Property
Returns a status value that indicates the success or failure of a prompt operation. Read-only.
statusValue = prompt.status
Remarks
When a prompt operation concludes successfully, the status property is set to zero. A non-zero value indicates that an error has occurred. The following table describes possible errors and their status values.
Status Value | Description |
---|---|
0 | No errors occurred. Speech concluded normally. |
-1 | Failed to queue the prompt onto the speech subqueue or the PromptQueue object. |
-2 | Failed to find a speech output resource (for distributed architectures). |
-3 | An invalid property/attribute setting caused a problem within the prompt request. |
-4 | Failed to resolve content. This is likely to be an unreachable Uniform Resource Identifier (URI), or malformed markup content. |
-5 | Failed to pause audio playback. This is a Microsoft-specific SALT extension that applies to all Microsoft speech clients except Telephony Application Services. |
-6 | Failed to resume audio playback. This is a Microsoft-specific SALT extension that applies to all Microsoft speech clients except Telephony Application Services. |
Events that cause the status codes to be set include oncomplete and onerror.
Example
The following code demonstrates the use of the status property.
<!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" onerror = "DoError()" >
This is error free text.
</salt:prompt>
<salt:prompt id="Prompt2" onerror = "DoError()" >
<src="Hello.wav" />
</salt:prompt>
<input type="button" name="BtnStart" value="Start Prompt" OnClick="StartPrompt1()" id="StartBtn">
<input type="button" name="BtnError" value="Start Error" OnClick="StartPrompt2()" id="ErrorBtn">
<br><br>
<input type="text" name="TxtOutput" size = "80" value="No error encountered" id="OutputTxt">
<script language="JScript">
<!--
function StartPrompt1() {
OutputTxt.value = "No error encountered";
Prompt1.Start();
}
function StartPrompt2() {
OutputTxt.value = "No error encountered";
Prompt2.Start();
}
function DoError() {
if (Prompt2.status == 0)
OutputTxt.value = "No error encountered";
else
OutputTxt.value = "An error occurred - status value:" + Prompt2.status;
}
-->
</script>
</body>
</html>
See Also
prompt Element | PromptQueue Object | oncomplete Event | onerror Event