tags:

views:

631

answers:

2

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.

+6  A: 

For windows, use the win32-sound library - Adding Sound to Your Ruby Apps.

You'd do something like:

Sound.beep(100, 500)

For non windows, looks like this could work: How to make beep sounds?

puts 7.chr
Chris Hynes
+12  A: 

Try printing the audible bell character:

print "\a"
yjerem