Share via


Communicating with Speech Server

  Microsoft Speech Technologies Homepage

Detecting Network Availability

Users in some application scenarios, particularly wireless applications, require quick notification when the network becomes unavailable. In a wireless network, the strength of radio frequency can vary wildly as the user moves, or as other people and objects in the environment move, resulting in Speech Server (MSS) being unavailable. This can be very frustrating to a user, since their application works fine one minute, and throws errors the next. Ideally, when the network is unavailable, the application will know, and can take appropriate action, such as warning the user, or working offline. When the network is available again, the application should resume normal operation automatically, since requiring manual intervention from the user would be a nuisance.

When a SALT page on the Pocket PC contains a server availability tag then the Pocket PC speech transport layer will periodically ping the speech server using the GetNewUrl SOAP message. By default this occurs every ten seconds. If more than one server is used on the page, each server is pinged. If a response is received, the server is marked as available. If no response is received, the server is marked as unavailable. State transitions are reported via the onserveravailable and onserverunavailable events. The following is an example of a server availability tag.

Note  The namespace attribute xmlns:msmm = "https://schemas.microsoft.com/speech/2002/12/salt/multimodal" is required in the HTML tag.

<html xmlns:salt = "http://www.saltforum.org/2002/SALT" xmlns:w3cgrammar="http://www.w3.org/2001/06/grammar" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:msmm = "https://schemas.microsoft.com/speech/2002/12/salt/multimodal">
  <head>
    <title>Test Network Detection</title>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta name="vs_targetSchema" content="https://schemas.microsoft.com/intellisense/ie5">
  </head>

  <body>
    <msmm:speechserveravailability id="ssid" onserveravailable="alert(ssid.server+' available')" onserverunavailable="alert(ssid.server+' unavailable')">
    </msmm:speechserveravailability>  
    <form>
    </form>
    <salt:prompt id="Prompt1">
      <salt:param name="server">http://SPEECHSERVERNAME/ses/lobby.asmx</salt:param>
      Hello World!          
    </salt:prompt>
  </body>
</HTML>

Configuring Network Detection

The following sections describe how to use the Speech applet in the Pocket PC control panel to configure network detection settings.

Setting the Client Keep Alive Timeout

The client keep-alive timeout is the interval between messages sent to the server for the purpose of verifying server availability. If there is no response to this message, the onserverunavailable event is fired.

To set the period between keep-alive attempts

  1. In the Pocket PC tap Start, and then Settings.
  2. On the System tab, tap Speech.
  3. On the Server Availability tab select the appropriate value for Keep-alive period.

Setting the SOAP Response Timeout

SOAP messages are sent to begin and end MSS sessions. All SOAP messages occur in pairs, corresponding to the HTTP request and response messages, and all pairs are initiated by the client. The SOAP response timeout defines the time period the client waits for a response before raising an error.

To set the SOAP response message timeout period

  1. In the Pocket PC tap Start, and then Settings.
  2. On the System tab, tap Speech.
  3. On the Server Availability tab select the appropriate value for SOAP response timeout.

Enabling and Configuring the Always Recording Feature

Users often speak before they trigger an application to start listening, and similarly, users will sometimes release the trigger moments before they stop speaking. Either of these actions results in portions of the utterance being lost. When Always Recording is enabled, the client continually records into a small circular buffer. When the listen starts, it will pre-pend the stream from the microphone with this small buffer; and when the listen ends, it will continue listening before closing the stream. Use the slider control to set the length of time recorded in the buffer before and after the listen. The client actively listens and records into this buffer only when there is an instance of Pocket Internet Explorer with a page containing a <listen> element.

To set the timeout period for a speech event

  1. In the Pocket PC tap Start, and then Settings.
  2. On the System tab, tap Speech.
  3. On the Server Recognition tab select Start recognition audio early and set the appropriate value for the cache size.

Configuring the Text-to-speech (TTS) Cache

Much of the text synthesis that occurs during an application session is repeated numerous times throughout that session. Even phrases that are different every time they are spoken are often mostly boilerplate text that is reused in numerous phrases. When synthesized speech is streamed from MSS the Pocket PC radio is active sending and receiving data. To reduce this, Speech Add-in for Microsoft Pocket Internet Explorer uses a cache that contains speech synthesis streams received from MSS, keyed by the text that was used as input to the speech synthesis. The TTS cache can be configured so that items leave the cache based on frequency of use, and the size of the cache.

To configure the TTS cache

  1. In the Pocket PC tap Start, and then Settings.
  2. On the System tab, tap Speech.
  3. On the Server TTS Cache tab select TTS Cache Release Order and set the appropriate values for TTS Cache Size.

See Also

Managing Application Resources | Using the Speech Add-in for Microsoft Pocket Internet Explorer