Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ruby wrapper for ‘espeak’ and ‘lame’ with sugar on top to create Text-To-Speech mp3 files.

License

NotificationsYou must be signed in to change notification settings

dejan/espeak-ruby

Repository files navigation

espeak-ruby is a small Ruby API for utilizingespeak andlame to create Text-To-Speech mp3 files or just speak (without saving).

Install

Addespeak-ruby to Gemfile

gem"espeak-ruby",require:"espeak"

Examples

# Speaks "YO!"speech=ESpeak::Speech.new("YO!")speech.speak# invokes espeak# Creates hello-de.mp3 filespeech=ESpeak::Speech.new("Hallo Welt",voice:"de")speech.save("hello-de.mp3")# invokes espeak + lame# Lists voicesESpeak::Voice.all.map{ |v|v.language}# ["af", "bs", "ca", "cs", "cy", "da", "de", "el", "en", "en-sc", "en-uk", "en-uk-north", "en-uk-rp", "en-uk-wmids", "en-us", "en-wi", "eo", "es", "es-la", "fi", "fr", "fr-be", "grc", "hi", "hr", "hu", "hy", "hy", "id", "is", "it", "jbo", "ka", "kn", "ku", "la", "lv", "mk", "ml", "nci", "nl", "no", "pap", "pl", "pt", "pt-pt", "ro", "ru", "sk", "sq", "sr", "sv", "sw", "ta", "tr", "vi", "zh", "zh-yue"]# Find particular voiceESpeak::Voice.find_by_language('en')#<ESpeak::Voice:0x007fe1d3806be8 @language="en", @name="default", @gender="M", @file="default">

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:capital=>170# increase emphasis (pitch) of capitalized words, 1 to 40 (for natural sound, can go higher):amplitude=>150# amplitude (volume) adjustment, 0 to 200

These are default values, and they can be easily overridden:

Speech.new("Zdravo svete",voice:"sr",pitch:90,speed:200).speak

Installing dependencies

OS X

brew install espeak lame

Ubuntu

sudo apt-get install espeak lame

Licence

espeak-ruby is released under theMIT License.

About

Ruby wrapper for ‘espeak’ and ‘lame’ with sugar on top to create Text-To-Speech mp3 files.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors6

Languages


[8]ページ先頭

©2009-2025 Movatter.jp