Partager via


InlinePrompt Property

  Microsoft Speech Technologies Homepage

Gets or sets the text of the DialogPrompt control. Read/write.

Usage

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

Remarks

The text of the InlinePrompt property may contain HTML-encoded markup elements of the following types:

  • Speech Synthesis Markup Language (SSML)
    SSML enables developers to customize the playing of prompt text by the Text-To-Speech (TTS) engine. SSML elements can modify the pitch, rate, volume, pronunciation and other characteristics of the TTS engine.

    Authors should not use ssml:speak tags in the InlinePrompt text. When Speech Controls play prompts, they automatically enclose prompt text elements within ssml:speak tags as needed. If the prompt text already contains ssml:speak tags, the resulting prompt will fail to play.

  • Prompt Engine Markup Language (PEML)
    PEML enables developers to customize the playing of prompt text by the Prompt engine. SSML elements provide developers with control of all Prompt engine functionality.

  • Speech Application Language Tags (SALT)
    SALT value elements enable developers to insert text from HTML controls into the prompt text.

When an application page is rendered, Speech Controls generate namespace declarations for the three types of markup elements. When creating markup elements, developers must use markup element namespaces exactly as shown in the following table.

Markup type Namespace Example (before HTML-encoding)
SSML ssml <ssml:sub alias="Speech A.P.I.">SAPI</ssml:sub>
PEML peml <peml:div />
SALT salt <salt:value targetelement="txtSize" targetattribute="value"> </salt:value>

Example

In this example, the first QA control collects the name and the size of a coffee beverage and places them in text boxes. The prompt text in the second QA control contains the HTML-encoded form of these SALT value elements:

<salt:value targetelement="txtSize" targetattribute="value">
</salt:value>
<salt:value targetelement="txtBeverage" targetattribute="value">
</salt:value>

These elements reference the text boxes that contain the beverage size and beverage type spoken by the user, for example, a "double espresso" or a "large mocha."

<form runat=server>
  ...
  <asp:textbox id="txtBeverage" runat=server></asp:textbox><br />
  <asp:textbox id="txtSize" runat=server></asp:textbox><br />
  ...
  <Speech:SemanticMap ID="TheSemanticMap" runat="server">
    <Speech:SemanticItem ID="siDrink" runat="server" AutoPostBack="true" 
      TargetElement="txtBeverage" TargetAttribute="Value">
    </Speech:SemanticItem>
    <Speech:SemanticItem ID="siSize" runat="server" AutoPostBack="true" 
      TargetElement="txtSize" TargetAttribute="Value">
    </Speech:SemanticItem>
  </Speech:SemanticMap>
  ...
  <Speech:QA ID="OrderBeverage" runat=server>
    <Prompt InlinePrompt="What kind of coffee would you like?" />
    <Reco Reject=".5" InitialTimeout="3000" MaxTimeout="30000">
      <Grammars><speech:Grammar src="caffe.xml" /></Grammars>
    </Reco>
    <Answers>
      <speech:Answer XPathTrigger="/SML/TYPE" SemanticItem="siDrink" />
      <speech:Answer XPathTrigger="/SML/SIZE" SemanticItem="siSize" />
    </Answers>
  </Speech:QA>

  <Speech:QA ID="Thanks" PlayOnce="True" runat=server>
    <Prompt InlinePrompt="Thank you. Your

      &lt;salt:value 
      targetelement=&quot;txtSize&quot; 
      targetattribute=&quot;value&quot;&gt;
      &lt;/salt:value&gt;

      &lt;salt:value 
      targetelement=&quot;txtBeverage&quot; 
      targetattribute=&quot;value&quot;&gt;
      &lt;/salt:value&gt;

      will be ready in a few minutes." />
  </Speech:QA>
  ...
</form>

See Also

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