Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi i am developing a course training application in which i need to convert displayed text to audio.

therefore i need to know how can i do this

what options do i have ?

Thanks.
Posted

Refer
Text to Speech[^]
 
Share this answer
 
Comments
Member 10266660 11-Sep-13 6:31am    
i have tried them but they are desktop application oriented
 
Share this answer
 
Comments
Member 10266660 11-Sep-13 14:17pm    
Thanks for answering ketan but i have used system.speechlib it does convert text to speech but i think it only plays in the server side .Can i convert the text to audio then stream or play on the client side.is there a way to do this
Thanks in advance
ketan italiya 12-Sep-13 0:56am    
try this..dude i think it will help you.

http://www.hanselman.com/blog/FallbackHTML5AudioTagsForASimpleMP3PodcastAreHarderThanYoudThink.aspx

http://stackoverflow.com/questions/13364731/converting-stream-to-wma

http://www.codeproject.com/Articles/435434/Text-to-Speech-tts-for-the-Web

Member 10266660 12-Sep-13 2:16am    
Ok i give up how can i do it in silver light.

Thanks .
 
Share this answer
 
Comments
Member 10266660 11-Sep-13 6:30am    
i have tried them but they are desktop application oriented
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Speech;
using System.Speech.Synthesis;

namespace ConvertTextToMp3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        SpeechSynthesizer reader = new SpeechSynthesizer();

        private void button1_Click(object sender, EventArgs e)
        {
            if (richTextBox1.Text != "")
            {
                reader.Dispose();
                reader = new SpeechSynthesizer();
                reader.SpeakAsync(richTextBox1.Text);

            }
            else
            {
                MessageBox.Show("please enter some text first");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (reader != null)
            {
                if (reader.State == SynthesizerState.Speaking)
                {
                    reader.Pause();
                }
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (reader != null)
            {
                if (reader.State == SynthesizerState.Paused)
                {
                    reader.Resume();
                }
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (reader != null)
            {

                reader.Dispose();

            }
        }

        private void button5_Click(object sender, EventArgs e)
        {
            reader.SetOutputToWaveFile("ConvertedMp3.wav");
            try
            {
                reader.Speak(richTextBox1.Text);
            }
            finally
            {
                reader.SetOutputToNull();
            }
        }
    }
}
 
Share this answer
 

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