Converting Text to Speech in WPF
//Reference: System.Speech dll
namespace WPFTextToSpeechSyntaxHelp
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class Speech : Window
{
//Create a Speech Object
SpeechSynthesizer speechObject = new SpeechSynthesizer();
public Speech()
{
InitializeComponent();
}
//Handling Button Click event
private void btnDisplayAudio_Click(object sender, RoutedEventArgs e)
{
// Calll SpeakAsync Method of the SpeechSynthesizer object that will convert the required text to speech
speechObject.SpeakAsync(TxtAreaResult.Text);
}
}
}