본문 바로가기

Programing (프로그래밍)/WPF & C# (C Sharp)

WPF & C# - Synthesis / 스피치 / 문장 읽기 / SpeechSynthesizer / Microsoft Zira Desktop / Microsoft Heami Desktop / 동영상 )

728x90
반응형
 WPF & C# - Synthesis / 스피치 / 문장 읽기 / SpeechSynthesizer / Microsoft Zira Desktop / Microsoft Heami Desktop / 동영상 )

Speeking.zip
0.04MB
Speeking.exe
0.01MB

 

 

Speech 를 사용하기 위해선 일단 참조추가를 한다.

 

System.Speech 를 찾아서 추가해주면 된다.

 

MainWindow.xaml

1
2
3
4
5
6
7
<Grid>
<StackPanel>
    <TextBox x:Name="tbx" HorizontalContentAlignment="Center">123</TextBox>
    <Button x:Name="btnEng" Click="btnEng_Click">Eng ( Microsoft Zira Desktop )</Button>
    <Button x:Name="btnKor" Click="btnKor_Click">Kor ( Microsoft Heami Desktop )</Button>
</StackPanel>
</Grid>
cs

 

MainWindow.xaml.CS

using System.Speech.Synthesis;

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public MainWindow()
{
    InitializeComponent();
}
 
SpeechSynthesizer synthesizer = new SpeechSynthesizer();
 
private void btnEng_Click(object sender, RoutedEventArgs e)
{
    synthesizer.SelectVoice("Microsoft Zira Desktop");
    synthesizer.Speak(tbx.Text);
}
 
private void btnKor_Click(object sender, RoutedEventArgs e)
{
    synthesizer.SelectVoice("Microsoft Heami Desktop");
    synthesizer.Speak(tbx.Text);
}
cs

 

 

참고

C#[C-Sharp]/WPF/TTS/음성합성 /SpeechSynthesizer/디자인 : 네이버 블로그 (naver.com)

 

C#[C-Sharp]/WPF/TTS/음성합성 /SpeechSynthesizer/디자인

TTS(Text To Speech) 는 문자열을 발음해주는 앱을 말합니다. 다른 말로는 음성 합성이라고 합니다....

blog.naver.com

 

728x90
반응형