SpeechSynthesizer.SetOutputToDefaultAudioDevice 메서드

정의

기본 오디오 디바이스에 출력을 보내도록 SpeechSynthesizer 개체를 구성합니다.

public:
 void SetOutputToDefaultAudioDevice();
public void SetOutputToDefaultAudioDevice ();
member this.SetOutputToDefaultAudioDevice : unit -> unit
Public Sub SetOutputToDefaultAudioDevice ()

예제

다음 예제에서는 신시사이저를 사용하여 기본 오디오 출력에 구를 말합니다.

using System;
using System.Speech.Synthesis;

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

      // Initialize a new instance of the speech synthesizer.
      using (SpeechSynthesizer synth = new SpeechSynthesizer())
      {

        // Configure the synthesizer to send output to the default audio device.
        synth.SetOutputToDefaultAudioDevice();

        // Speak a phrase.
        synth.Speak("This is sample text-to-speech output.");
      }

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

설명

Windows 제어판소리 창을 사용하여 컴퓨터에 대한 기본 오디오 디바이스를 구성할 수 있습니다.

다른 출력 구성 옵션은 , , SetOutputToNullSetOutputToWaveFileSetOutputToWaveStream 메서드를 SetOutputToAudioStream참조하세요.

적용 대상