WPF - Working with Text-to-speech



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);
        }
    }
}

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.