Compartir vía


PromptBuilder.AppendTextWithHint Método

Definición

Anexa texto al objeto PromptBuilder y especifica el tipo de contenido del texto.

Sobrecargas

AppendTextWithHint(String, String)

Anexa texto al objeto PromptBuilder y un String que especifica el tipo de contenido del texto.

AppendTextWithHint(String, SayAs)

Anexa texto al objeto PromptBuilder y especifica el tipo de contenido usando un miembro de la enumeración SayAs.

AppendTextWithHint(String, String)

Anexa texto al objeto PromptBuilder y un String que especifica el tipo de contenido del texto.

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)

Parámetros

textToSpeak
String

Cadena que contiene el texto que se va a decir.

sayAs
String

Tipo de contenido del texto.

Comentarios

Puede usar este método para especificar un tipo de contenido que no está incluido en la SayAs enumeración . Sin embargo, el motor de TTS debe admitir el parámetro que especifique.

Se aplica a

AppendTextWithHint(String, SayAs)

Anexa texto al objeto PromptBuilder y especifica el tipo de contenido usando un miembro de la enumeración SayAs.

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)

Parámetros

textToSpeak
String

Cadena que contiene el texto que se va a decir.

sayAs
SayAs

Tipo de contenido del texto.

Ejemplos

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();  
    }  
  }  
}  

Comentarios

El tipo de contenido especificado por sayAs puede proporcionar instrucciones al motor de síntesis de voz sobre cómo pronunciar el contenido de textToSpeak .

Se aplica a