Added to “utility/enhancements.rb”…
class String
#Uses Windows Speech API to speak string.
def speak
require 'win32/sapi5'
Win32::SpVoice.new.Speak(self.to_s)
end
end
99.downto(1) {|n| "#{n} bottles of beer on the wall".speak}
Added to “utility/enhancements.rb”…
class String
#Uses Windows Speech API to speak string.
def speak
require 'win32/sapi5'
Win32::SpVoice.new.Speak(self.to_s)
end
end
99.downto(1) {|n| "#{n} bottles of beer on the wall".speak}