Share via


Additional Client Scripting Elements

  Microsoft Speech Technologies Homepage

These are public client-side functions supported by the RunSpeech object and the client-side objects of several Dialog Speech Controls and Application Speech Controls. Other functions are not guaranteed to be maintained.

RunSpeech

The RunSpeech client object exposes functionality that is used by Dialog Speech Controls and by Application Speech Controls.

ActiveQA Property

Gets the client-side object of the most recently-active QA control. Read-only.

The History property of this object contains the Command/Exception History of the QA control.

CurrentCall Method

Returns a CallInfo object that contains information about the current phone call.

Currently only a single phone call is supported.

CallInfo RunSpeech.CurrentCall()

Parameters

None.

Return value

A CallInfo object that contains information about the current phone call.

GetEventSource Method

Gets the type of SALT object that caused the most recent event.

When an application detects a noreco event, for example, GetEventSource may return a value of dtmf or listen. This indicates whether the event was caused by an invalid keypress or by unrecognized speech.

Each SALT event changes the value returned by GetEventSource. If no SALT event has occurred on the page, the method returns an empty string.

string RunSpeech.GetEventSource()

Parameters

None.

Return value

dtmf, prompt, listen, smex, or empty string.

GetSemanticItem Method

Returns the client object of the SemanticItem Speech Control with the specified ID.

If the ID is not matched, RunSpeech navigates to the error page.

This method is useful when an application needs to access or modify a SemanticItem control in client script, but the ID of the SemanticItem is not known until runtime.

SemanticItem RunSpeech.GetSemanticItem( string ID )

Parameters

The ID of the SemanticItem.

Return value

The client object of the SemanticItem with the specified ID.

OnUserDisconnected Property

Gets or sets the name of a client-side function that is called when the caller disconnects.

The value of the OnUserDisconnected property is the name of the custom client-side script function, without parameters or parentheses. RunSpeech calls this function, using the following syntax, when the caller disconnects.

Authors can use this method to perform application-specific tasks when the user hangs up or is disconnected.

Syntax

<script>
  ...
  function MyUserDisconnected()
  {
    // Custom code for OnUserDisconnected
  }
  ...
  RunSpeech.OnUserDisconnected = MyUserDisconnected;
  ...
</script>

Parameters

None.

Return value

None.

Pause Method

Pauses RunSpeech dialogue flow.

This method is useful when Basic Speech Controls or SALT tags are mixed with Dialog Speech Controls. The parameter stopCurrent indicates whether current Prompt, Listen or Dtmf objects should be stopped immediately.

void RunSpeech.Pause( Boolean stopCurrent )

Parameters

  • stopCurrent
    If true, the current object is stopped.

Return value

None.

Reset Method

Resets RunSpeech and the Speech Controls on the current page.

The Reset method performs the following operations upon controls on the current page:

void RunSpeech.Reset()

Parameters

None.

Return value

None.

Resume Method

Resumes RunSpeech dialogue flow.

This method is useful when Basic Speech Controls or SALT tags are mixed with Dialog Speech Controls.

void RunSpeech.Resume()

Parameters

None.

Return value

None.

Other Client Objects

The client-side object of the SemanticItem Speech Control provides access to recognized text, alternate recognitions, attributes and the confirmation status of data items.

The client-side object of the CallInfo Call Control provides access to the CallInfo object that represents the current call. The client-side object of the TransferCall Call Control enables authors to change the phone number to which a call is transferred.