Skip to content
forked from dejan/espeak-ruby

Small Ruby API for utilizing ‘espeak’ and ‘lame’ to create Text-To-Speech mp3 files.

Notifications You must be signed in to change notification settings

zjr/espeak-ruby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

espeak-ruby

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.

Install

gem install espeak-ruby

Example

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")

Features

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)

Requirements

  • espeak-http - Micro web app for Text-To-Speech conversion via HTTP powered by Ruby, Sinatra, lame, espeak and espeak-ruby

Licence

Copyright © 2008 Dejan Simic

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Small Ruby API for utilizing ‘espeak’ and ‘lame’ to create Text-To-Speech mp3 files.

Resources

Stars

Watchers

Forks

Packages

No packages published