Giter Club home page Giter Club logo

ruby-flite's Introduction

Ruby Flite

Ruby Flite is a small speech synthesis library for ruby using CMU Flite.

CMU Flite (festival-lite) is a small, fast run-time synthesis engine developed at CMU and primarily designed for small embedded machines and/or large servers. Flite is designed as an alternative synthesis engine to Festival for voices built using the FestVox suite of voice building tools.

Supported versions

  • ruby 2.0.0 and uppper
  • CMU Flite 1.4 and 2.0.

Installation

Install CMU Flite and (optionally) LAME.

On ubuntu

sudo apt-get install flite1-dev
sudo apt-get install libmp3lame-dev # for mp3 support (optionally)

On redhat

yum install flite-devel
yum install libmp3lame-devel # for mp3 support (optionally)

On Windows You have no need to install CMU Flite and LAME if you use ruby 2.0.x, 2.1.x or 2.2.x distributed by rubyinstaller.org. Binary gems for the rubies include them. If you use other ruby versions, you need to install CMU Flite, LAME and Development Kit.

Others You need to install them by yourself.

And then execute:

$ gem install flite

Ruby Flite tries to link with all voices and languages. If you want to reduce dependent libraries, execute the followings instead of above command.

$ gem install flite -- --with-voices=kal --with-langs=eng

Examples

require 'flite'

# Speak "Hello World!"
"Hello World!".speak

# Create a wav data and save as "hello_world.wav"
File.binwrite("hello_world.wav", "Hello World!".to_speech)

# Create a mp3 data and save as "hello_world.mp3"
# This works if mp3 support is enabled.
File.binwrite("hello_world.mp3", "Hello World!".to_speech(:mp3))

# Change the voice used for String#speak and String#to_speech
Flite.default_voice = 'rms'

# Speak again
"Hello World!".speak

See:

Sample Applications

saytime - talking clock

This is inspired by saytime - talking clock for SPARCstations.

Example:

Talk the current time once:

saytime

Talk the current time forever:

saytime --loop

Talk the current time 5 times

saytime --loop 5

Talk the current time 5 times with 10 second intervals

saytime --loop 5 --interval 10

speaking-web-server - Web server replying synthesized speech

Usage:

Start a web server:

speaking-web-server

Open a browser and access:

http://HOSTNAME_OR_IP_ADDRESS:9080
(Change HOSTNAME_OR_IP_ADDRESS.)

Click 'Play' buttons.

Restrictions

  • Ruby process doesn't terminate while talking.

  • When an error occurs in CMU Flite, the error message is outputted to the standard error.

  • When a fatal error occurs in CMU Flite, the error message is outputted to the standard error and the process is terminated. (CMU Flite calls exit(-1)...)

NEWS

0.1.1

  • The exception class name Flite::Runtime was renamed to to Flite::RuntimeError.
  • Binary gems for Windows bundle precompiled extension libraries for ruby 2.2.1.

0.1.0

Almost methods were changed. Especially {String#to_speech} returns WAV audio data instead of speaking. Use {String#speak} to speak a text.

License

  • Ruby Flite is licensed under 2-clause BSD-style license.
  • CMU Flite bundled in Windows binary gems is licensed under BSD-like license. See http://www.festvox.org/flite/download.html
  • LAME bundled in Windows binary gems is licensed under LGPL.

Related Works

Contributing

  1. Fork it ( https://github.com/kubo/ruby-flite/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

ruby-flite's People

Contributors

kubo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.