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
'C#' 카테고리의 다른 글
C# / string to datetime 변경 / 날짜, 시간 비교 / 날짜, 시간 포맷, 양식 정하기 (0) | 2021.05.26 |
---|---|
C# / system.outofmemoryexception (0) | 2021.05.25 |
C# / switch case range, switch case 범위 연산자 (0) | 2021.05.18 |
C# / 화면 캡처 해서 바탕 화면에 폴더 만들어서 저장 하기 (0) | 2021.04.14 |
C# / 텍스트 박스 전부 비우기 (0) | 2021.04.12 |