Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good free text to speech API for spelling word tutor

I am writting a spelling word application for my son and would like recomendations for good APIs that can be understood when it speaks. I am programming in .Net so something that will interop with that would be handy. Thanks in advance.

like image 367
Jeremy E Avatar asked Jun 10 '09 12:06

Jeremy E


1 Answers

Don't know why I didn't think of this before -
I was doing a dictionary-lookup tool, and wanted to add pronunciation to it. Rather than use Text-to-speech, which gives a robotic sound, I took a different approach. M-W.com has human voices captured in .wav files for most words. So I screen-scrape the Merriam-Webster website to grab a wav file for the word, and then just play that. If your app will be connected, then maybe this would work for you, too.

This is the flow it goes through:

pronouncing Tricky...looking up 'Tricky'...
dictionary page: http://www.merriam-webster.com/dictionary/Tricky
got dictionary page markup, 35828 chars...
getting pronunciation uri...
got uri: 'http://www.merriam-webster.com//cgi-bin/audio.pl?tricky01.wav=tricky'...
getting page markup...
got pronunciation page markup, 3498 chars...
getting wav uri...
got wav uri: 'http://media.merriam-webster.com/soundc11/t/tricky01.wav'...
getting wav data...
got wav data, 6260 bytes...
playing wav data.
done.

Here's some prototype source code that does it.

This works on the .NET Framework 2.0, and also works on the .NET CF 2.0. It's just an illustration. It sort of naive about selecting the proper .wav file when there are multiple word forms and multiple pronunciations. If you ask for a plural form, you may not get it. Also you may want to add caching and additional exception handling to harden it.

like image 168
Cheeso Avatar answered Nov 11 '22 05:11

Cheeso