Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

Festival TTS for Ruby

This text-to-speech engine uses Ruby and festival. Listen to the output as an mp3 sample [twittergram.com]

Prerequisites:
sudo apt-get install festival lame
sudo gem install festivaltts4r

require "rubygems"
require "festivaltts4r"
				
"I'm talking".to_speech


Reference: Festival TTS for Ruby - Make your Ruby Strings talk! [rubyforge.org]

Digg/RSS Reader

Grabs the RSS-feed from digg.com and reads it out
loud using festival.

#!/bin/sh
# Copyright (c) 2005 Davor Babic <davorb@gmail.com>
# All rights reserved.
# Usage of the works is permitted provided that this
# instrument is retained with the works, so that any
# entity that uses the works is notified of this
# instrument.
# DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.

url="http://digg.com/rss/index.xml"

echo "Parsing RSS..."
curl --silent "$url" | grep -E '(title>|description>)' | \
        sed -n '4,$p' | \
	sed -e 's/<title>//' -e 's/<\/title>//' -e 's/<description>/  /' \
	    -e 's/<\/description>//' | head -5 > digg 
echo "Reading..."
festival --tts digg
rm -rf ./digg
echo "Done."
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS