espeak-ruby is small Ruby API for utilizing ‘espeak’ and ‘lame’ to create Text-To-Speech mp3 files.
-
eSpeak is a compact open source software speech synthesizer for English and other languages, for Linux and Windows.
-
LAME is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL.
gem install espeak-ruby
require 'rubygems' require 'espeak-ruby' include ESpeak # Creates hello.mp3 file espeak("hello.mp3", :text => "Hello World") # Creates /home/espeak/hello-de.mp3 file espeak("/home/espeak/hello-de.mp3", :text => "Hallo Welt", :voice => "de")
Currently only subset of espeak features is supported.
:voice => 'en', # use voice file of this name from espeak-data/voices :pitch => 50, # pitch adjustment, 0 to 99 :speed => 170 # speed in words per minute, 80 to 370 :quiet => true # prevent espeak-ruby from printing to stdout. (default false)
These are default values, and they can be easily overridden:
espeak("zdravo.mp3", :text => "Zdravo svete", :voice => "sr", :pitch => 90, :speed => 200)
-
espeak-http - Micro web app for Text-To-Speech conversion via HTTP powered by Ruby, Sinatra, lame, espeak and espeak-ruby
Author: Dejan Simic