Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've a windows application, in which there is a text box. In the text box the user will put some hindi text and the text will be converted to audio file.

I've used the following code

C#
try
        {
            using (SpeechSynthesizer speechSynthesizerObj = new SpeechSynthesizer())
            {
                PromptBuilder builder = new PromptBuilder(new System.Globalization.CultureInfo("hi"));
                builder.AppendText(txtText.Text);
                speechSynthesizerObj.SetOutputToWaveFile(@"D:\Work\AudioFile\NugetTestAudio.wav");
                // Speak the prompt.
                speechSynthesizerObj.Speak(builder);

            }
            MessageBox.Show("Text to media file conversion done!!!");
        }
        catch (Exception ex)
        {
            string message = ex.Message;
        }


The code is not throwing any error, and the audio file is getting generated, but there is nothing inside the audio file if I play.

Please, let me know what is missing in the code
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900