PromptBuilder.AppendText メソッド

定義

テキストを PromptBuilder オブジェクトに追加します。

オーバーロード

AppendText(String)

PromptBuilder オブジェクトに追加されるテキストを指定します。

AppendText(String, PromptEmphasis)

テキストを PromptBuilder オブジェクトに追加し、テキストの強調の度合いを指定します。

AppendText(String, PromptRate)

テキストを PromptBuilder オブジェクトに追加し、テキストの読み上げ速度を指定します。

AppendText(String, PromptVolume)

テキストを PromptBuilder オブジェクトに追加し、テキストの音量を指定します。

AppendText(String)

PromptBuilder オブジェクトに追加されるテキストを指定します。

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

パラメーター

textToSpeak
String

読み上げるテキストを含む文字列。

次の例では、 オブジェクトを PromptBuilder 作成し、 メソッドを使用してテキスト文字列を 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();  
    }  
  }  
}  

注釈

SSML マークアップ言語として書式設定されたテキストを追加するには、 を使用 AppendSsmlMarkupします。

適用対象

AppendText(String, PromptEmphasis)

テキストを PromptBuilder オブジェクトに追加し、テキストの強調の度合いを指定します。

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)

パラメーター

textToSpeak
String

読み上げるテキストを含む文字列。

emphasis
PromptEmphasis

テキストに適用する強調またはストレスの値。

注釈

Windows の音声合成エンジンでは、現時点では強調パラメーターはサポートされていません。 強調パラメータの値を設定すると、合成された音声出力に聞こえる変化は生じなくなります。

適用対象

AppendText(String, PromptRate)

テキストを PromptBuilder オブジェクトに追加し、テキストの読み上げ速度を指定します。

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)

パラメーター

textToSpeak
String

読み上げるテキストを含む文字列。

rate
PromptRate

テキストに適用する話し速度の値。

次の例では、 オブジェクトを PromptBuilder 作成し、テキスト文字列を追加します。 この例では、 メソッドを 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();  
    }  
  }  
}  

適用対象

AppendText(String, PromptVolume)

テキストを PromptBuilder オブジェクトに追加し、テキストの音量を指定します。

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)

パラメーター

textToSpeak
String

読み上げるテキストを含む文字列。

volume
PromptVolume

テキストに適用する音量 (大きさ) の値。

次の例では、 メソッドを AppendText 使用して、音声出力に適用する SpeechSynthesizer ボリューム設定を指定します。

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

注釈

の設定はDefaultフル ボリュームです。これは と同じですExtraLoudPromptVolume その他の設定では、完全ボリュームに対する音声出力の量が減少します。

適用対象