Share via


PromptBuilder.Culture Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Gets the culture information of a PromptBuilder.

Namespace: Microsoft.SpeechServer.Synthesis
Assembly: Microsoft.SpeechServer (in microsoft.speechserver.dll)

Syntax

'Declaration
Public Property Culture As CultureInfo
public CultureInfo Culture { get; }

Property Value

A System.Globalization.CultureInfo object containing the current culture information.

Remarks

The Culture property is initialized with the CurrentUICulture property value of the parent TelephonySession object.

The value of the CurrentUICulture property follows the definition found in the Internet Engineering Task Force (IETF) RFC1766 specification. The value consists of a two-letter language code, a hyphen, and a two-letter nation code. For example, en-UK represents English (United Kingdom), es-US represents Spanish (United States), and fr-CA represents French (Canada).

When comparing the Culture of two objects, use the results of the ToString method, as shown in the example.

Example

using Microsoft.SpeechServer.Synthesis;
. . .
        private void statementActivity1_TurnStarting(object sender, TurnStartingEventArgs e)
        {
            PromptBuilder pb = new PromptBuilder();
            Microsoft.SpeechServer.Synthesis.VoiceInfo dvi = Workflow.Synthesizer.DefaultVoice;
            pb.AppendText("This is " + dvi.Name + ", the default voice. ");
            foreach (Microsoft.SpeechServer.Synthesis.VoiceInfo vi in Workflow.Synthesizer.InstalledVoices)
            {
                if (vi.Culture.ToString() == dvi.Culture.ToString())
                {
                    if (vi.Name != dvi.Name)
                    {
                        pb.StartVoice(vi);
                        pb.AppendText("This is " + vi.Name + ", another voice");
                        pb.EndVoice();
                    }
                }
            }
            pb.AppendText("This is " + dvi.Name + ", the default voice again. ");
            statementActivity1.MainPrompt.AppendPromptBuilder(pb);
        }

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Windows Server 2003

See Also

Reference

PromptBuilder Class
PromptBuilder Members
Microsoft.SpeechServer.Synthesis Namespace