views:

322

answers:

4

I'm an IT student. I want to write an web browser for blind people. How can I use C# or java to write an application to pronounce some text from a XML file (Text to Speech)?

+2  A: 

For .NET, have a look at the Speech APIs. There's a quick introduction to it here.

Hope that's enough to get you started.

Nader Shirazie
+1- That was to the point! thanks
Webbisshh
+1  A: 

It might be worth looking at accessibility guidelines for the web, this is a good place to start: http://www.w3.org/TR/WCAG10/

This will at least indicate what people are doing to support accessibility which will give you an idea of what your application should do. (eg reading ALT and TITLE tags)

C# can certainly be used to parse web pages and in addition to the text to speech built into the .NET framework there will be 3rd party libraries that you can integrate with.

You can also have a look at existing screen reader applications to give you some inspiration: eg: http://www.freedomscientific.com/products/fs/jaws-product-page.asp

Mark Redman
+3  A: 

You can use the SpeechSynthesizer class from the .Net Framework:

  1. Add a reference to System.Speech.dll
  2. Add a using statement for System.Speech.Synthesis
  3. Use this code:

    SpeechSynthesizer synthesizer = new SpeechSynthesizer();
    synthesizer.Speak("Hello world! How are you?");
    
There are probably higher-quality speech synthesis tools available. Write a wrapper method for Speak so that you can upgrade later. SpeechSynthesizer should be good to get you started though.
A: 

For Java, this question gives you some Text To Speach options, but writing a whole web browser has a lot more to it than just the text to speech. Unless you are looking for something specifically cross platform (which I'm guessing not since you include .NET as an option), Windows comes with TTS accessibility options and of course a web browser built in.

With .NET you can use it's Speech API and interact with Internet Explorer to get you the web browser functionality. Definitely the shortest route, but it may not bring much over the built in Windows abilities.

Yishai