PromptBuilder.AppendTextWithHint Methode

Definition

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

Überlädt

Name Beschreibung
AppendTextWithHint(String, String)

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

AppendTextWithHint(String, SayAs)

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

AppendTextWithHint(String, String)

Quelle:
PromptBuilder.cs
Quelle:
PromptBuilder.cs
Quelle:
PromptBuilder.cs
Quelle:
PromptBuilder.cs

Fügt Text an das PromptBuilder Objekt an und ein String Objekt, das 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 Inhaltstyp des Texts.

Hinweise

Mit dieser Methode können Sie einen Inhaltstyp angeben, der nicht in der SayAs Enumeration enthalten ist. Das TTS-Modul muss jedoch den von Ihnen angegebenen Parameter unterstützen.

Gilt für:

AppendTextWithHint(String, SayAs)

Quelle:
PromptBuilder.cs
Quelle:
PromptBuilder.cs
Quelle:
PromptBuilder.cs
Quelle:
PromptBuilder.cs

Fügt Text an das PromptBuilder Objekt an und gibt den Inhaltstyp mithilfe eines Elements 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 Inhaltstyp 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 sayAs ihnen angegebene Inhaltstyp kann dem Sprachsynthesemodul Anleitungen zur Aussprache des Inhalts des textToSpeakInhalts liefern.

Gilt für: