dejan / espeak-ruby Goto Github PK
View Code? Open in Web Editor NEWRuby wrapper for ‘espeak’ and ‘lame’ with sugar on top to create Text-To-Speech mp3 files.
License: MIT License
Ruby wrapper for ‘espeak’ and ‘lame’ with sugar on top to create Text-To-Speech mp3 files.
License: MIT License
How do I go about configuring that?
I am using this code in rails application and when I try following:
Speech.new(char).bytes.force_encoding('ASCII-8BIT')
It creates a process with name espeak
in the system but doesn't kill it. Hence, as many times, it is called it leaves a zombie process behind, which are deleted only when we restart the application server. This has led to the memory leak. The change got added in the last version i.e. 1.0.3 due to popen
. Any thoughts?
Hi,
There are following test failures with Ruby 2.7:
┌──────────────────────────────────────────────────────────────────────────────┐
│ Run tests for ruby2.7 from debian/ruby-tests.rake │
└──────────────────────────────────────────────────────────────────────────────┘
RUBYLIB=. GEM_PATH=/home/utkarsh/debian/ruby-team/espeak/ruby-espeak/debian/ruby-espeak/usr/share/rubygems-integration/all:/home/utkarsh/.gem/ruby/2.7.0:/var/lib/gems/2.7.0:/usr/lib/ruby/gems/2.7.0:/usr/share/rubygems-integration/2.7.0:/usr/share/rubygems-integration/all:/usr/lib/x86_64-linux-gnu/rubygems-integration/2.7.0 ruby2.7 -S rake -f debian/ruby-tests.rake
/usr/bin/ruby2.7 -w -I"test" "/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/rake_test_loader.rb" "test/cases/speech_test.rb" "test/cases/voice_test.rb" "test/test_helper.rb" -v
Loaded suite /usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/rake_test_loader
Started
SpeechTest:
test_save: .: (0.022006)
VoiceTest:
test_all: F
===============================================================
11: def test_all
12: all_voices = Voice.all
13: assert all_voices.size > 0
=> 14: assert %w(M F).include?(all_voices.first.gender)
15: end
16:
17: def test_find_by_language
/home/utkarsh/debian/ruby-team/espeak/ruby-espeak/test/cases/voice_test.rb:14:in `test_all'
Failure: test_all(VoiceTest): <false> is not true.
===============================================================
: (0.028455)
test_find_by_language: E
===============================================================
16:
17: def test_find_by_language
18: voice = Voice.find_by_language('en')
=> 19: assert_equal 'en', voice.language
20: end
21: end
/home/utkarsh/debian/ruby-team/espeak/ruby-espeak/test/cases/voice_test.rb:19:in `test_find_by_language'
Error: test_find_by_language(VoiceTest): NoMethodError: undefined method `language' for nil:NilClass
===============================================================
: (0.004145)
Finished in 0.055004519 seconds.
---------------------------------------------------------------
3 tests, 4 assertions, 1 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
33.3333% passed
---------------------------------------------------------------
54.54 tests/s, 72.72 assertions/s
rake aborted!
Command failed with status (1): [ruby -w -I"test" "/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/rake_test_loader.rb" "test/cases/speech_test.rb" "test/cases/voice_test.rb" "test/test_helper.rb" -v]
/usr/share/rubygems-integration/all/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => default
(See full trace by running task with --trace)
ERROR: Test "ruby2.7" failed. Exiting.
Any clue on how to fix this?
Just wanted to check if there was a way that I am not seeing. Plan is to just create a file for each "speaker" and then combine them into one mp3. thanks!
require 'espeak'
include ESpeak
speech = Speech.new("something")
speech.speak
2015-12-26 16:54:48.870 espeak[38793:10049883] 16:54:48.870 WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
Hi @dejan,
Thanks a bunch for working on this! \o/
However, I am using espeak-ruby
like this:
speech = ESpeak::Speech.new("put on charging, your battery is at #{capacity}%.")
speech.speak
But even if the system's volume is low or on mute, ESpeak
yells at full volume. :P
Is there a nice way to make sure it's in sync with the system volume? Let me know if it already exists and I haven't looked thoroughly. TIA!
This enables you to read env variables:
speech = Speech.new("$HOME")
speech.speak
May be it is possible to perform RCE injection.
Hello,
Could you make a new release of espeak-ruby with the fix for ruby 2.7 so I could update the Debian package?
Thanks
/Users/raven_hacks/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/espeak-ruby-1.1.0/lib/espeak/voice.rb:17:in popen': No such file or directory - espeak (Errno::ENOENT) from /Users/raven_hacks/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/espeak-ruby-1.1.0/lib/espeak/voice.rb:17:in
all'
from /Users/raven_hacks/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/espeak-ruby-1.1.0/lib/espeak.rb:8:in <top (required)>' from <internal:/Users/raven_hacks/.rbenv/versions/3.0.4/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
require'
from internal:/Users/raven_hacks/.rbenv/versions/3.0.4/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb:160:in rescue in require' from <internal:/Users/raven_hacks/.rbenv/versions/3.0.4/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
require'
from epseak.rb:1:in <main>' <internal:/Users/raven_hacks/.rbenv/versions/3.0.4/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
require': cannot load such file -- espeak (LoadError)
from internal:/Users/raven_hacks/.rbenv/versions/3.0.4/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb:85:in require' from epseak.rb:1:in
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.