Permalink
Browse files

Added a way to set speaking rate

  • Loading branch information...
1 parent 4b99181 commit ef015d357cced237f95b036b8fdef297749ad424 @kethomassen kethomassen 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
@@ -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} aswell!", "Victoria", 190
# Execute arbitrary applescript
applescript 'foo'
@@ -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} aswell!", "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
@@ -1,3 +1,3 @@
module Commander
- VERSION = '4.1.3'
+ VERSION = '4.1.5'
end

0 comments on commit ef015d3

Please sign in to comment.