Partilhar via


Recognizing Speech

  Microsoft Speech Technologies Homepage

Use the server setting of the param attribute of the listen element to identify the server, as in the following example.

     <salt:listen id="Reco1" onreco="HandleOnReco()" onnoreco="HandleOnNoReco">
      <salt:param name="server">http://yourspeechserver/ses/lobby.asmx</salt:param>
      <salt:grammar src="airport.grxml">
      </salt:grammar>
    </salt:listen>

The following example shows the contents of the remote grammar file referenced in the previous example.

<grammar version="1.0" tag-format="semantics-ms/1.0" xmlns="http://www.w3.org/2001/06/grammar" 
 root="Airports" lang="en-US" type="application/srgs+xml">

  <rule id="Airports">
    <one-of>
      <item>Heathrow</item>
      <item>Gatwick</item>
      <item>San Diego</item>
    </one-of>
    <ruleref="#FlightDay" />
  </rule>

  <rule id="FlightDay">
    on
    <one-of>
      <item>Monday</item>
      <item>Wednesday</item>
      <item>Friday</item>
    </one-of>
  </rule>

</grammar>

Granting Rights to Inline Grammars

Using inline grammars requires a server administrator to grant a specific user the right to execute them. The security risk is high for allowing a user to navigate to any Web site and submit script from that site, in the form of an inline grammar, to run on Microsoft Speech Server (MSS). An administrator is unlikely to grant this right. For this reason developers should not use inline grammars on the Speech Add-in for Microsoft Pocket Internet Explorer. Instead, use a grammar file that is on a Web server trusted by Speech Server.

See Also

Using the Speech Add-in for Microsoft Pocket Internet Explorer | Introducing Computer Speech Technology | Enabling Speech Recognition