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-4 of 4 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]

Using Espeak

Espeak is a Text-to-speech program which I have used on Ubuntu. A sample of the audio can be found from my twittergram [twittergram.com]. Note: I made a few spelling mistakes in the audio, listen and tell me if you can hear them.

espeak -f hello_jr -s 120

Speech recognition

The code is too long. I'd rather just make a link.
It uses MS Speech SDK 5.1 via COM.

Text-to-speech

>>> import win32com.client
>>> s = win32com.client.Dispatch("SAPI.SpVoice")
>>> s.Speak('Hello, how are you?')

You need MS Speech SDK installed. See recipe.
« Newer Snippets
Older Snippets »
Showing 1-4 of 4 total  RSS