Last active
December 23, 2015 11:59
-
-
Save adamhunter/6632543 to your computer and use it in GitHub Desktop.
using say in ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# after pasting the class in speaker.rb into irb, run the following, | |
# edit to your liking... | |
@speaker = Speaker.new | |
# other voices can be found at | |
# http://www.gabrielserafini.com/blog/2008/08/19/mac-os-x-voices-for-using-with-the-say-command/ | |
@speaker.voice = 'Kathy' | |
@speaker.what = %[what should i say here?] | |
@speaker.speak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in terminal (mac only), run irb, then paste below | |
class Speaker | |
attr_accessor :what, :voice | |
def speak | |
%x[say -v #{voice} #{what}] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment