PromptBuilder.AppendText Metoda

Definicja

Dołącza tekst do PromptBuilder obiektu.

Przeciążenia

AppendText(String)

Określa tekst do dołączania do PromptBuilder obiektu.

AppendText(String, PromptEmphasis)

Dołącza tekst do PromptBuilder obiektu i określa stopień wyróżnienia tekstu.

AppendText(String, PromptRate)

Dołącza tekst do PromptBuilder obiektu i określa szybkość mówienia tekstu.

AppendText(String, PromptVolume)

Dołącza tekst do PromptBuilder obiektu i określa wolumin, aby mówić tekst.

AppendText(String)

Źródło:
PromptBuilder.cs
Źródło:
PromptBuilder.cs
Źródło:
PromptBuilder.cs

Określa tekst do dołączania do PromptBuilder obiektu.

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

Parametry

textToSpeak
String

Ciąg zawierający tekst, który ma być wypowiadany.

Przykłady

Poniższy przykład tworzy PromptBuilder obiekt i dołącza ciąg tekstowy AppendText przy użyciu metody .

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 append a text string.  
        PromptBuilder speakText = new PromptBuilder();  
        speakText.AppendText("Say the name of the song you want to hear");  

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

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

Uwagi

Aby dołączyć tekst sformatowany jako język znaczników SSML, użyj polecenia AppendSsmlMarkup.

Dotyczy

AppendText(String, PromptEmphasis)

Źródło:
PromptBuilder.cs
Źródło:
PromptBuilder.cs
Źródło:
PromptBuilder.cs

Dołącza tekst do PromptBuilder obiektu i określa stopień wyróżnienia tekstu.

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

Parametry

textToSpeak
String

Ciąg zawierający tekst, który ma być wypowiadany.

emphasis
PromptEmphasis

Wartość podkreślenia lub podkreślenia, która ma być stosowana do tekstu.

Uwagi

Aparaty syntezy mowy w systemie Windows nie obsługują obecnie parametru nacisku. Ustawienie wartości parametru wyróżnienia spowoduje, że żadne zmiany nie będą słyszalne w syntetyzowanych danych wyjściowych mowy.

Dotyczy

AppendText(String, PromptRate)

Źródło:
PromptBuilder.cs
Źródło:
PromptBuilder.cs
Źródło:
PromptBuilder.cs

Dołącza tekst do PromptBuilder obiektu i określa szybkość mówienia tekstu.

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

Parametry

textToSpeak
String

Ciąg zawierający tekst, który ma być wypowiadany.

rate
PromptRate

Wartość współczynnika mówienia, która ma być stosowana do tekstu.

Przykłady

Poniższy przykład tworzy PromptBuilder obiekt i dołącza ciągi tekstowe. W przykładzie AppendText użyto metody , aby określić powolny współczynnik mówienia dla dodawanego ciągu, który wylicza zawartość zamówienia.

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 add content.  
        PromptBuilder speakRate = new PromptBuilder();  
        speakRate.AppendText("Your order for");  
        speakRate.AppendText("one kitchen sink and one faucet", PromptRate.Slow);  
        speakRate.AppendText("has been confirmed.");  

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

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

Dotyczy

AppendText(String, PromptVolume)

Źródło:
PromptBuilder.cs
Źródło:
PromptBuilder.cs
Źródło:
PromptBuilder.cs

Dołącza tekst do PromptBuilder obiektu i określa wolumin, aby mówić tekst.

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

Parametry

textToSpeak
String

Ciąg zawierający tekst, który ma być wypowiadany.

volume
PromptVolume

Wartość głośności mówienia (głośność), która ma być stosowana do tekstu.

Przykłady

W poniższym przykładzie AppendText użyto metody , aby określić ustawienia woluminu SpeechSynthesizer , które powinny być stosowane do danych wyjściowych mowy.

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

        // Build a prompt that applies different volume settings.  
        PromptBuilder builder = new PromptBuilder();  
        builder.AppendText("This is the default speaking volume.", PromptVolume.Default);  
        builder.AppendBreak();  
        builder.AppendText("This is the extra loud speaking volume.", PromptVolume.ExtraLoud);  
        builder.AppendBreak();  
        builder.AppendText("This is the medium speaking volume.", PromptVolume.Medium);  

        // Speak the prompt.  
        synth.Speak(builder);  
      }  

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

Uwagi

Ustawienie Default dla PromptVolume jest pełnym woluminem, co jest takie samo jak ExtraLoud. Inne ustawienia zmniejszają ilość danych wyjściowych mowy względem pełnego woluminu.

Dotyczy