PromptBuilder.AppendTextWithHint Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Anexa texto al PromptBuilder objeto y especifica el tipo de contenido del texto.
Sobrecargas
| Nombre | Description |
|---|---|
| AppendTextWithHint(String, String) |
Anexa texto al PromptBuilder objeto y que String especifica el tipo de contenido del texto. |
| AppendTextWithHint(String, SayAs) |
Anexa texto al PromptBuilder objeto y especifica el tipo de contenido mediante un miembro de la SayAs enumeración. |
AppendTextWithHint(String, String)
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
Anexa texto al PromptBuilder objeto y que String 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 hablar.
- 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)
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
Anexa texto al PromptBuilder objeto y especifica el tipo de contenido mediante un miembro de la SayAs enumeración.
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 hablar.
- 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.