PromptBuilder.AppendTextWithHint Methode

Definition

Fügt Text an das PromptBuilder-Objekt an und gibt den Inhaltstyp des Texts an.

Überlädt

AppendTextWithHint(String, String)

Fügt Text an das PromptBuilder-Objekt an und eine String, die den Inhaltstyp des Texts angibt.

AppendTextWithHint(String, SayAs)

Fügt Text an das PromptBuilder-Objekt an und gibt den Inhaltstyp mithilfe eines Members der SayAs-Enumeration an.

AppendTextWithHint(String, String)

Fügt Text an das PromptBuilder-Objekt an und eine String, die den Inhaltstyp des Texts angibt.

public:
 void AppendTextWithHint(System::String ^ textToSpeak, System::String ^ sayAs);
public void AppendTextWithHint (string textToSpeak, string sayAs);
member this.AppendTextWithHint : string * string -> unit
Public Sub AppendTextWithHint (textToSpeak As String, sayAs As String)

Parameter

textToSpeak
String

Eine Zeichenfolge, die den zu sprechenden Text enthält.

sayAs
String

Der Inhaltstyps des Texts.

Hinweise

Sie können diese Methode verwenden, um einen Inhaltstyp anzugeben, der nicht in der -Enumeration enthalten SayAs ist. Die TTS-Engine muss jedoch den von Ihnen angegebenen Parameter unterstützen.

Gilt für

AppendTextWithHint(String, SayAs)

Fügt Text an das PromptBuilder-Objekt an und gibt den Inhaltstyp mithilfe eines Members der SayAs-Enumeration an.

public:
 void AppendTextWithHint(System::String ^ textToSpeak, System::Speech::Synthesis::SayAs sayAs);
public void AppendTextWithHint (string textToSpeak, System.Speech.Synthesis.SayAs sayAs);
member this.AppendTextWithHint : string * System.Speech.Synthesis.SayAs -> unit
Public Sub AppendTextWithHint (textToSpeak As String, sayAs As SayAs)

Parameter

textToSpeak
String

Eine Zeichenfolge, die den zu sprechenden Text enthält.

sayAs
SayAs

Der Inhaltstyps des Texts.

Beispiele

using System;  
using System.Speech.Synthesis;  

namespace SampleSynthesis  
{  
  class Program  
  {  
    static void Main(string[] args)  
    {  

      // Initialize a new instance of the SpeechSynthesizer.  
      using (SpeechSynthesizer synth = new SpeechSynthesizer())  
      {  

        // Configure the audio output.   
        synth.SetOutputToDefaultAudioDevice();  

        // Create a PromptBuilder object and define the data types for some of the added strings.  
        PromptBuilder sayAs = new PromptBuilder();  
        sayAs.AppendText("Your");  
        sayAs.AppendTextWithHint("1st", SayAs.NumberOrdinal);  
        sayAs.AppendText("request was for");  
        sayAs.AppendTextWithHint("1", SayAs.NumberCardinal);  
        sayAs.AppendText("room, on");  
        sayAs.AppendTextWithHint("10/19/2012,", SayAs.MonthDayYear);  
        sayAs.AppendText("with early arrival at");  
        sayAs.AppendTextWithHint("12:35pm", SayAs.Time12);  

        // Speak the contents of the SSML prompt.  
        synth.Speak(sayAs);  
      }  

      Console.WriteLine();  
      Console.WriteLine("Press any key to exit...");  
      Console.ReadKey();  
    }  
  }  
}  

Hinweise

Der von angegebene Inhaltstyp sayAs kann der Sprachsynthese-Engine Anleitungen zum Aussprechen des Inhalts von textToSpeak bereitstellen.

Gilt für