Search code examples
javaaudiotext-to-speech

Java phonetics or language pronounciation


I am currently making a project for school, where I am going to make a program which teaches children how to read. My basic idea for the program was produce the sentence and then get Windows Anna to say it. My question to you is, how can I access Winodws Anna through Java? and is there a better way of doing this?

Thanks


Solution

  • If having the program access internet is acceptable, then you could use iSpeech.

    You can use their API, but the problem with that is that it is limited to 200 uses/day.

    iSpeech has decently sounding voices, generally more polished than other TTS engines I've tired like espeak or FreeTTS, because it actually pronounces the words more fluently. Sure, it might pronounce 'Wind', relating with air, as 'Wind', relating to twisting, but other than that, it speaks quite well.

    Also, while I haven't had any prior experience with this, I found an article that shows you how to access the MS Speech with command line (which can obviously be commanded through Java[if you do not know how, here is a good article]). It is located here. In command line, all you do is type in 'SayDynamic.exe* the text you want to speak".

    *Or SayStatic, the other download available on the page.

    This method seems to be better in terms of speed and not relying on internet access, but it definitely does NOT pronounce things as well as iSpeech. I guess the ideal thing for your program to have would be to use iSpeech when online, and use the Say*.exe when offline.

    The site also provides the source code of the program. As you might notice, it is NOT Microsoft Anna's voice, but you can specify that in the source and recompile it.

    Hope I helped!