Share via


PromptBuilder.AppendText Yöntem

Tanım

Nesneye PromptBuilder metin ekler.

Aşırı Yüklemeler

AppendText(String)

Nesneye PromptBuilder eklenecek metni belirtir.

AppendText(String, PromptEmphasis)

Metni nesneye PromptBuilder ekler ve metnin vurgu derecesini belirtir.

AppendText(String, PromptRate)

Nesneye PromptBuilder metin ekler ve metin için konuşma hızını belirtir.

AppendText(String, PromptVolume)

Nesneye PromptBuilder metin ekler ve metni konuşacak birimi belirtir.

AppendText(String)

Kaynak:
PromptBuilder.cs
Kaynak:
PromptBuilder.cs
Kaynak:
PromptBuilder.cs

Nesneye PromptBuilder eklenecek metni belirtir.

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

Parametreler

textToSpeak
String

Konuşulacak metni içeren bir dize.

Örnekler

Aşağıdaki örnek bir PromptBuilder nesnesi oluşturur ve yöntemini kullanarak bir metin dizesi ekler AppendText .

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

Açıklamalar

SSML işaretleme dili olarak biçimlendirilmiş metin eklemek için kullanın AppendSsmlMarkup.

Şunlara uygulanır

AppendText(String, PromptEmphasis)

Kaynak:
PromptBuilder.cs
Kaynak:
PromptBuilder.cs
Kaynak:
PromptBuilder.cs

Metni nesneye PromptBuilder ekler ve metnin vurgu derecesini belirtir.

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)

Parametreler

textToSpeak
String

Konuşulacak metni içeren bir dize.

emphasis
PromptEmphasis

Metne uygulanacak vurgu veya stres değeri.

Açıklamalar

Windows'daki konuşma sentezi altyapıları şu anda vurgu parametresini desteklemez. Vurgu parametresi için değerlerin ayarlanması, sentezlenen konuşma çıkışında duyulabilir bir değişiklik oluşturmaz.

Şunlara uygulanır

AppendText(String, PromptRate)

Kaynak:
PromptBuilder.cs
Kaynak:
PromptBuilder.cs
Kaynak:
PromptBuilder.cs

Nesneye PromptBuilder metin ekler ve metin için konuşma hızını belirtir.

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)

Parametreler

textToSpeak
String

Konuşulacak metni içeren bir dize.

rate
PromptRate

Metne uygulanacak konuşma hızının değeri.

Örnekler

Aşağıdaki örnek bir PromptBuilder nesne oluşturur ve metin dizelerini ekler. Örnek, eklenen dize için bir siparişin içeriğini numaralandıran yavaş konuşma hızı belirtmek için yöntemini kullanır AppendText .

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

Şunlara uygulanır

AppendText(String, PromptVolume)

Kaynak:
PromptBuilder.cs
Kaynak:
PromptBuilder.cs
Kaynak:
PromptBuilder.cs

Nesneye PromptBuilder metin ekler ve metni konuşacak birimi belirtir.

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)

Parametreler

textToSpeak
String

Konuşulacak metni içeren bir dize.

volume
PromptVolume

Metne uygulanacak konuşma ses düzeyinin (ses düzeyi) değeri.

Örnekler

Aşağıdaki örnek, konuşma çıkışı için AppendText geçerli olması gereken birim ayarlarını SpeechSynthesizer belirtmek için yöntemini kullanır.

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

Açıklamalar

Default için PromptVolume ayarı ile aynı ExtraLoudolan tam birimdir. Diğer ayarlar, konuşma çıkışının tam ses düzeyine göre ses düzeyini azaltır.

Şunlara uygulanır