SpeechSynthesizer.SpeakSsml(String) 메서드

정의

SSML 태그를 포함하는 String을 동기적으로 말합니다.

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

매개 변수

textToSpeak
String

말할 SSML 문자열입니다.

예제

다음 예제에서는 날짜 1/29/2009를 월, 일, 연도 순서의 날짜로 렌더링합니다.

using System;
using System.Speech.Synthesis;

namespace SampleSynthesis
{
  class Program
  {
    static void Main(string[] args)
    {

      // Initialize a new instance of the SpeechSynthesizer.
      SpeechSynthesizer synth = new SpeechSynthesizer();

      // Configure the audio output.
      synth.SetOutputToDefaultAudioDevice();

      // Build an SSML prompt in a string.
      string str = "<speak version=\"1.0\"";
      str += " xmlns=\"http://www.w3.org/2001/10/synthesis\"";
      str += " xml:lang=\"en-US\">";
      str += "<say-as type=\"date:mdy\"> 1/29/2009 </say-as>";
      str += "</speak>";

      // Speak the contents of the prompt synchronously.
      synth.SpeakSsml(str);

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

설명

내용의 textToSpeak 매개 변수를 포함 해야 합니다는 speak 요소에 맞아야 합니다 Speech Synthesis Markup Language (SSML) 버전 1.0합니다. 자세한 내용은 Speech Synthesis Markup 언어 참조합니다.

SSML 태그가 포함된 문자열을 비동기적으로 말하려면 메서드를 SpeakSsmlAsync 사용합니다. 를 사용하여 Speak SSML 태그가 포함되지 않은 문자열의 동기식 말하기를 시작할 수 있습니다.

이 메서드를 호출하는 동안 은 SpeechSynthesizer 다음 이벤트를 발생할 수 있습니다.

  • StateChanged. 신시사이저의 말하기 상태가 변경될 때 발생합니다.

  • SpeakStarted. 신시사이저가 음성 생성을 시작할 때 발생합니다.

  • PhonemeReached. 신시사이저가 언어로 음성의 신중한 소리를 구성하는 문자 또는 문자의 조합에 도달 할 때마다 발생합니다.

  • SpeakProgress. 신시사이저가 단어 말하기를 완료할 때마다 발생합니다.

  • VisemeReached. 음성 출력이 발생할 때마다 발생하려면 입이나 음성을 생성하는 데 사용되는 얼굴 근육의 위치를 변경해야 합니다.

  • BookmarkReached. 프롬프트에서 신시사이저가 책갈피를 발견할 때 발생합니다.

  • VoiceChange. 신시사이저의 말하기 음성이 변경될 때 발생합니다.

SpeechSynthesizer 메서드를 SpeakCompleted 처리하는 SpeakSsml 동안 이벤트를 발생시키지 않습니다.

적용 대상