Added a way to set speaking rate in speech method #57

Merged
merged 2 commits into from Jul 20, 2013
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