728x90

먼저 참조 에서 System.Speech 를 추가 한다.

 

SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer();
speechSynthesizer.SetOutputToDefaultAudioDevice();
speechSynthesizer.Volume = 100; //없어도 상관 없음
speechSynthesizer.SelectVoice("Microsoft Heami Desktop"); // 한국어 지원은 Heami 만 가능, 없어도 됨, 있으면 오류 나는경우가 있는거 같음
speechSynthesizer.Speak("퇴근 하고 싶다.");

 

좀더 자연스러운 목소리르 사용 하고 싶으면 파파고 음성을 녹음 하면 좋겠지만

상업용 프로그램에는 라이센스 문제가 있을 수 있어 잘 알아보고 사용 하는게 좋을거 같다.

 

출처:

https://imsoftpro.tistory.com/60

https://learn.microsoft.com/ko-kr/dotnet/api/system.speech.synthesis.speechsynthesizer?view=netframework-4.8

 

728x90

+ Recent posts