Code Monkey home page Code Monkey logo

Comments (8)

Animesh-Ghosh avatar Animesh-Ghosh commented on June 12, 2024 3

Hey @utkarsh2102, so I think for this, it would be enough for the library to provide the amplitude option, mentioned in the command line options here, which you could then further use in your script.

@dejan it's just a matter of adding support for the -a option in the ESpeak::Speech module which I would be happy to do.
I hacked around a bit locally and the diff came out to look like the following:

diff --git a/lib/espeak/speech.rb b/lib/espeak/speech.rb
index f682905..c8e4ca5 100644
--- a/lib/espeak/speech.rb
+++ b/lib/espeak/speech.rb
@@ -12,6 +12,7 @@ module ESpeak
     #    :speed     - speed in words per minute, 80 to 370
     #    :capital   - increase emphasis of capitalized letters by raising pitch by this amount
     #                 no range given in man but good range is 10-40 to start
+    #    :amplitude - amplitude adjustment, 0 to 200
     #    :quiet     - remove printing to stdout. Affects only lame (default false)
     #
     def initialize(text, options = {})
@@ -73,12 +74,13 @@ module ESpeak
         pitch: 50,
         speed: 170,
         capital: 1,
+        amplitude: 100,
         quiet: true }
     end
 
     def espeak_command(options, flags = '')
       ['espeak', @text.to_s, flags.to_s, "-v#{options[:voice]}", "-p#{options[:pitch]}", "-k#{options[:capital]}",
-       "-s#{options[:speed]}"]
+       "-s#{options[:speed]}", "-a#{options[:amplitude]}"]
     end
 
     def std_lame_command(options)

PS: thanks to @rajudev for pointing the issue in @utkarsh2102's repository, which prompted me to contribute to this repository!

from espeak-ruby.

dejan avatar dejan commented on June 12, 2024 2

This is now available in just released v1.1.0. Thank you @utkarsh2102 and @Animesh-Ghosh.

from espeak-ruby.

utkarsh2102 avatar utkarsh2102 commented on June 12, 2024 1

Hi @dejan,

This is now available in just released v1.1.0.

Awesome, thank you very much! Can you please re-trigger the CI? It's weirdly failing on the last commit. :(

Hopefully just re-running the pipeline should suffice.

from espeak-ruby.

utkarsh2102 avatar utkarsh2102 commented on June 12, 2024

Hey @Animesh-Ghosh,

This is greatttt! Thank you! \o/

from espeak-ruby.

utkarsh2102 avatar utkarsh2102 commented on June 12, 2024

Hey @dejan, could you possibly take a look at this quick bug fix? This shall help us respect the system's volume whilst using the gem. TIA! :)

from espeak-ruby.

dejan avatar dejan commented on June 12, 2024

it's just a matter of adding support for the -a option in the ESpeak::Speech module which I would be happy to do.

@Animesh-Ghosh please create a PR and I'll merge

from espeak-ruby.

utkarsh2102 avatar utkarsh2102 commented on June 12, 2024

Yay, thank you! ❤️

from espeak-ruby.

Animesh-Ghosh avatar Animesh-Ghosh commented on June 12, 2024

@Animesh-Ghosh please create a PR and I'll merge

@dejan PR #22 created. Please check it out, thanks!

from espeak-ruby.

Related Issues (10)

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.