I'm making a small ruby command line script and I wanted to know what the simplest way to have the program emit a beep is.
I'm making a small ruby command line script and I wanted to know what the simplest way to have the program emit a beep is.
For windows, use the win32-sound gem - Adding Sound to Your Ruby Apps.
To install:
gem install win32-sound
Then in Ruby:
require 'win32/sound'
include Win32
...
Sound.beep(100, 500)
For non-windows, looks like this could work: How to make beep sounds?
puts 7.chr