Permalink
Browse files

Merge pull request #57 from kethomassen/master

Added a way to set speaking rate in speech method
  • Loading branch information...
2 parents 4b99181 + 5182548 commit 6f00a845c3088650fbb5f4d3b8202f58a1f3b33a @ggilder ggilder committed Jul 20, 2013
Showing with 10 additions and 6 deletions.
  1. +1 −0 README.rdoc
  2. +8 −5 lib/commander/user_interaction.rb
  3. +1 −1 lib/commander/version.rb
View
1 README.rdoc
@@ -159,6 +159,7 @@ following methods to simplify common tasks:
speak 'What is your favorite food? '
food = ask 'favorite food?: '
speak "Wow, I like #{food} too. We have so much in common."
+ speak "I like #{food} as well!", "Victoria", 190
# Execute arbitrary applescript
applescript 'foo'
View
13 lib/commander/user_interaction.rb
@@ -119,22 +119,25 @@ def color(*args)
end
##
- # Speak _message_ using _voice_ which defaults
- # to 'Alex', which is one of the better voices.
+ # Speak _message_ using _voice_ at a speaking rate of _rate_
+ #
+ # Voice defaults to 'Alex', which is one of the better voices.
+ # Speaking rate defaults to 175 words per minute
#
# === Examples
#
# speak 'What is your favorite food? '
# food = ask 'favorite food?: '
- # speak "wow, I like #{food} too. We have so much alike."
+ # speak "Wow, I like #{food} too. We have so much in common."
+ # speak "I like #{food} as well!", "Victoria", 190
#
# === Notes
#
# * MacOS only
#
- def speak message, voice = :Alex
- Thread.new { applescript "say #{message.inspect} using #{voice.to_s.inspect}" }
+ def speak message, voice = :Alex, rate = 175
+ Thread.new { applescript "say #{message.inspect} using #{voice.to_s.inspect} speaking rate #{rate}" }
end
##
View
2 lib/commander/version.rb
@@ -1,3 +1,3 @@
module Commander
- VERSION = '4.1.3'
+ VERSION = '4.1.4'
end

0 comments on commit 6f00a84

Please sign in to comment.