There a couple ways to accomplish this. My application required the first option because the second wouldn’t work from within Eclipse.
require “win32/sound”
include Win32
Sound.play(SystemAsterisk”, Sound::ALIAS) # play system asterisk sound
Sound.beep(600,200) # play a beep 600 hertz for 200 milliseconds
or
irb(main):001:0> puts “\a”
=> nil
irb(main):002:0>
The Ruby on Windows blog has some additional info about Adding Sound to Your Ruby […]
August 16, 2008












Posted in



Recent Comments