PromptBuilder.AppendTextWithHint メソッド

定義

テキストを PromptBuilder オブジェクトに追加し、テキストのコンテンツ タイプを指定します。

オーバーロード

AppendTextWithHint(String, String)

テキストを PromptBuilder オブジェクトに追加し、テキストのコンテンツ タイプを指定する String を追加します。

AppendTextWithHint(String, SayAs)

テキストを PromptBuilder オブジェクトに追加し、SayAs 列挙型のメンバーを使用してコンテンツ タイプを指定します。

AppendTextWithHint(String, String)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

テキストを PromptBuilder オブジェクトに追加し、テキストのコンテンツ タイプを指定する String を追加します。

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)

パラメーター

textToSpeak
String

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

sayAs
String

テキストのコンテンツ タイプ。

注釈

このメソッドを使用して、列挙に含まれていないコンテンツ タイプを SayAs 指定できます。 ただし、TTS エンジンでは、指定したパラメーターをサポートする必要があります。

適用対象

AppendTextWithHint(String, SayAs)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

テキストを PromptBuilder オブジェクトに追加し、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)

パラメーター

textToSpeak
String

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

sayAs
SayAs

テキストのコンテンツ タイプ。

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

注釈

sayAs 指定されたコンテンツ タイプは、 の内容 textToSpeakの発音方法に関するガイダンスを音声合成エンジンに提供できます。

適用対象