April 25, 2008

TweetSpeech - Twitter to Speech Pipe

I don't know what prompted it, but yesterday I started looking for a registration free RSS2speech service that I could use to produce and audio version of a Twitter feed. I did find Expressivo, which sort of lets you create audio messages for text strings up to a couple of characters long:

expressivo

If you want to see the result, scroll down to the end fo the post - the bit in the middle is the techie "how to do it "detail... ;-)

What I had been hoping for was a 10 minute hack to get an audio file enclosure added to a twitter stream, by using something like:
http://mp3generator.expressivo.com?say=say%20this%20out%20loud
to get an MP3 file I could use to augment the twitter stream...

But it didn't look that simple... so I tweeted, David Flanders replied, and I thought 'what the heck...'

So here was the problem - go to an Expressivo page with a particular message, like this one.

The audio plays from the page. At the bottom of the page is a link to the audio file:

expressivo share

The download URL is not nice though... http://say.expressivo.com:8080/media/37/72/3772bb468373baab54bc2a17adc2c33dd.mp3

Which isn't so much of a problem - I can pull the page into a Yahoo pipe and just scrape it to pull the URL out, right...? (Yahoo pipes can be used as rudimentary screen scrapers.)

expressivo js

Wrong - the link is generated by a Javascipt/AJAX function...

Hmm...

Well, if I can recreate the AJAX call, I can then parse the URL out of what's returned from the MP3 file url generating service... One quick way of finding out what AJAX call the page is making is to watch the header traffic flowing through my browser:

expressivo header

So I can recreate a call to the Expressivo MP3 generatr, and hopefully get a response back containing ther URL of the MP3 file.

Here's a pipe to test that bit out - Expressivo MP3 Test pipe

expressivo MP3 pipe

What this pipe does is produce a single item RSS feed that contains an enclosure corresponding to an MP3/spoken version of the message that is passed in to the pipe.

So now, all I have to do to get a Twitter2speech service running is to embed this pipe in another pipe that pulls in a Twitter feed, pass it each tweet, and attach the appropriate MP3 file attachment as an enclosure to the Twitter stream - TweetSpeech pipe:

tweetspeech pipe

So to recap - the output of the TweetSpeech pipe is a twitter friends stream for a particular Twitter user, with each item augmented with an MP3 file as an enclosure that speaks the tweet aloud...

The result is most easily viewed/listened to in a Grazr widget:

Grazr

Just click on any item and you should get an embedded player that will play the tweet aloud... (at least, until Expressivo maybe decide they don't like this hack!;-)

PS I have received reassurances from Grazr that the widget will continue to be supported, as a free service: "NOTHING will change with the widget or any existing feature. Whatever is there will remain there. Whatever is free now will remain free always."

Blogged with the Flock Browser

Tags: , , , ,

Posted by ajh59 at April 25, 2008 11:39 AM
Comments

Not quite sure it's what you want Tony, but have you looked at Utterz? You can record audio from your phone, and the link goes straight to twitter.

Posted by: Martin at May 5, 2008 12:58 PM