Partilhar via


lang Attribute

  Microsoft Speech Technologies Homepage

Specifies the language to which the prompt refers.

<prompt lang="lang">

Remarks

The value of the lang attribute follows the definition found in the Internet Engineering Task Force (IETF) RFC1766 specification. The RFC1766 specification allows for a rich suite of languages, although not all are supported by the Microsoft Speech Application SDK. The tags are case insensitive. The language tag is a string composed of one or more parts. The first part is a two-character designation of the basic language. For example, "en" is for English; "no", Norwegian; "fr", French; "de", German. The second part is separated by a hyphen and designates the variation or dialect of the language. "en-US" is for United States English, "en-cockney" is for Cockney English.

  • If the lang attribute is unspecified for the prompt element, a higher level element in the page propagates the lang value down to prompt element.
  • If the lang attribute is specified in multiple places, the language ID follows an order of precedence from the lowest scope to the highest scope.
  • If lang is completely unspecified in any scope, a platform-specific value is used.

Example

The following code demonstrates the use of the lang attribute

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns:salt="http://www.saltforum.org/2002/SALT">
  <head>
    <object id="Speechtags" CLASSID="clsid:DCF68E5B-84A1-4047-98A4-0A72276D19CC" VIEWASTEXT></object>
  </head>
    
  <body>
    <?import namespace="salt" implementation="#Speechtags" />
    
    <salt:prompt id="Prompt1" xmlns="http://www.w3.org/2001/10/synthesis" lang="en-US">
      <salt:content type="application/ssml+xml" href="./greeting1.ssml" />
    </salt:prompt>
        
    <input type="button" name="BtnStart1" value="Start Prompt" OnClick="StartPlayback1()" id="Button1">

    <script language="JScript">
    <!--
      function StartPlayback1() {
        Prompt1.Start("You have <emphasis>five dollars</emphasis> left in your account.");  
      }
    -->
    </script>
  </body>
</html>

See Also

prompt Element |  xmlns Attribute