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 | 1 Comment | Permalink
Submit to digg, del.icio.us, reddit, or stumbleupon

1 Comment

Alexander Craghead said on 06/20/03 @ 04:14 PM:
Hmm... a little short tho. But the voice itself is surprising... err... sexy, actually. Sounds much better than the one Apple uses in it's text-to-speech system.

Post a comment












HTML Allowed: a href, b, br, p, strong, em, ul, li, blockquote




Note: There is currently a problem with special characters causing errors when you try to comment, so if you're copying information from another Web site that has smart quotes or em dashes or ellipses or similar, please remove them and manually type them out.

Comment Policy: Comments on older entries or comments containing a bunch of links are moderated automatically on this site to help fight comment spam. If you don't see your comment after submitting, it will appear on the site after it has been approved. We also reserve the right to remove your comment for any reason we see fit, but if you keep it remotely on topic, it'll stay.

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 - 2008 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. Technorati Profile.