Partilhar via


OnClientSpeechDetected Property

  Microsoft Speech Technologies Homepage

Gets or sets the name of a client-side function that is called when the platform detects user speech. Read/write.

Usage

ASP.NET markup: <speech:Reco OnClientSpeechDetected="..." />
Get value: String = Reco.OnClientSpeechDetected;
Set value: Reco.OnClientSpeechDetected = String;
Data type: String
Required: No

Remarks

Recognition engines may raise the onspeechdetected event at any point between the first detection of sound in an utterance and the return of recognition results. If a DialogPrompt is playing, the onspeechdetected event raises a client onbargein event.

If a Dtmf object is active when the OnClientSpeechDetected function is called, the time-outs of the Dtmf object will be disabled.

The value of the OnClientSpeechDetected property is the name of this custom client-side script function, without parameters or parentheses. The client-side dialog manager calls this function, using the following syntax, when the client onspeechdetected event is detected.

The script block that contains this function should be placed before the control that calls the function. For more information, see "Placement of Script Blocks" in Authoring Notes.

Syntax

function FunctionName ()
{
     // Client-side code referenced by Reco.OnClientSpeechDetected
}

Parameters

None.

Return Value

None.

Example

<form id="Form1" method="post" runat="server">
  ...
  <script>
  function myClientSpeechDetected (){
    // OnClientSpeechDetected
    return true;
  }
  </script>
  ...
  <speech:qa id="qaOrig" runat="server">
    <Prompt id="prompt1" InlinePrompt="What is your originating city?"></Prompt>
    <Reco id="recoOrig" InitialTimeout="3000" BabbleTimeout="10000" EndSilence="1000" Reject="0.5"
      OnClientSpeechDetected="myClientSpeechDetected" >
      <Grammars>
        <speech:grammar src="grammars/cities.xml" runat="server"></speech:grammar>
      </Grammars>
    </Reco>
    <Answers>
      <speech:answer id="ansOrig" XPathTrigger="/sml/origcity" SemItem="siOrig" runat="server">
      </speech:answer>
    </Answers>
  </speech:qa>
  ...
</form>

See Also

Reco Class | Reco Constructor | Reco Members | Reco Properties | Reco Methods | Reco Events | Reco Remarks