Utterly Boring dot com

Now have this blog read to you!

Got this link via Chris Pirillo's site. If you notice, next to where it says "Trackback" for each entry on my site, you have a bit of text that says "Read It To Me." Click on that to get a WAV file of the text in the entry, read by the AT&T Research Labs Text to Speech Converter. The original site had a bit of code there that displayed a button to pull it off, but I couldn't stand having a button in my entries, so I hacked it a bit to write a text link. Here's what I did:

In my <MTEntries> tag, I put the following:

<FORM METHOD="post" NAME="demoForm<$MTEntryID pad="1"$>" ACTION="http://morrissey.naturalvoices.com/tts/cgi-bin/nph-talk"><input type="hidden" name="txt" value="<$MTEntryBody words="49" remove_html="1"$>"><input type="hidden" name="voice" VALUE="crystal"><input type="hidden" name="rate" VALUE="8000"></FORM>

I limited the MTEntryBody length to 49 because the converter chokes on more than that, so longer entries will get cut off.

Then, my bit of text to display the link looks like so:

<a name="SpeakButton" href="javascript: document.demoForm<$MTEntryID pad="1"$>.submit();">Read It To Me</a>

This link does not have to be within the <FORM> tag to work properly, just as long as it's in the same <MTEntries> tag.

I've also put the MTEntryID in the form name and in the JavaScript call to it, otherwise you'll have a pile of forms on each page that all have the same name -- and JavaScript doesn't like that.

What do you think? I know it's a stupid feature, but so what? ;-)

Posted by Jake on 06/19/03 @ 06:03 PM
Posted in Site Info | Permalink



2 Trackbacks

Say It Louder! from Gonzonia - A Sovereign Nation of Weird on 06/20/03 @ 06:05 AM:
Thanks to UtterlyBoring I've changed the 'Say It' to a link. Blends much better than that button! UPDATE: Apparently it doesn't like double-quotes. Just an FYI!... (Read More)

Let's hear it for pointless features! from Xkot on 09/21/03 @ 12:35 PM:
Shall we play a game? If you're feeling too lazy to actually read my posts, now you can click the 'Speak It' link on each entry to have them read to you. The first 49 words of them, anyway, since that is the maximum it will handle. It works well with s... (Read More)

What are you doing down here? Don't you have something better to do? Like Go Back To The Top of the page, or even see who created this site? This site is © 2001 - 2017 by the Utterly Boring folks at UtterlyBoring.com. Steal my content, as I probably did, too, just link to my site or the original site. Batteries not included. One size fits all. Not for off-road use. Not for internal use. Do not taunt Happy Fun Ball.