SpeechSynthesizer.SpeakSsmlAsync(String) 메서드

정의

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

public:
 System::Speech::Synthesis::Prompt ^ SpeakSsmlAsync(System::String ^ textToSpeak);
public System.Speech.Synthesis.Prompt SpeakSsmlAsync (string textToSpeak);
member this.SpeakSsmlAsync : string -> System.Speech.Synthesis.Prompt
Public Function SpeakSsmlAsync (textToSpeak As String) As Prompt

매개 변수

textToSpeak
String

언급할 SMML 태그입니다.

반환

말할 내용이 들어 있는 개체입니다.

예외

textToSpeaknull입니다.

예제

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 asynchronously.
      synth.SpeakSsmlAsync(str);

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

이 메서드는 메서드의 동기 대응에서 throw할 수 있는 모든 비사용 예외를 반환하는 작업에 저장됩니다. 예외가 반환된 작업에 저장되면 작업이 대기될 때 해당 예외가 throw됩니다. 와 같은 ArgumentException사용 예외는 여전히 동기적으로 throw됩니다. 저장된 예외는 에서 throw SpeakSsml(String)된 예외를 참조하세요.

설명

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

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

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

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

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

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

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

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

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

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

  • SpeakCompleted. 신시사이저가 작업 처리를 SpeakSsmlAsync 완료할 때 발생합니다.

사용자 애플리케이션 dos 말하는 동안 작업을 수행할 필요가 없습니다, 하는 경우 사용할 수 있습니다 합니다 Speak 또는 SpeakSsml 음성을 동기적으로 생성 하는 방법입니다.

적용 대상