Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 2 commits into from

2 participants

@kethomassen

Overview

Adds a way to set the speaking rate (wpm) in the speech method without having to manually use the applescript method

Examples

speak "HELLO!", "Alex", 250 # Says "HELLO!" with voice "Alex" at a speaking rate of 250 wpm
speak "HELLO!" # Says "HELLO!" with voice "Alex" at a default speaking rate of 175 wpm

Changes

  • Added speech rate parameter to method speech
  • Updated documentation to reflect changes
  • Bumped version to 4.1.4 (from 4.1.3)
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} aswell!", "Victoria", 190
@ggilder Collaborator
ggilder added a note

typo "aswell" -> "as well"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/commander/user_interaction.rb
((10 lines not shown))
#
# === 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
@ggilder Collaborator
ggilder added a note

same typo here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/commander/version.rb
@@ -1,3 +1,3 @@
module Commander
- VERSION = '4.1.3'
+ VERSION = '4.1.5'
@ggilder Collaborator
ggilder added a note

Why skip 4.1.4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ggilder
Collaborator

Left a couple of comments, looks good to me otherwise. If you fix those I will merge and release.

@kethomassen kethomassen Bump version down to '4.1.4'
* Fixes spelling errors ('aswell' -> 'as well')
* Changes version back down to 4.1.4
5182548
@kethomassen

Fixed :+1:

@ggilder ggilder merged commit 6f00a84 into tj:master
@ggilder
Collaborator

Just released v4.1.4 with your addition. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 20, 2013
  1. @kethomassen
  2. @kethomassen

    Bump version down to '4.1.4'

    kethomassen authored
    * Fixes spelling errors ('aswell' -> 'as well')
    * Changes version back down to 4.1.4
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.