What is the easiest way I can create a 'beep' sound from a Ruby program?

前端 未结 5 798
甜味超标
甜味超标 2021-01-31 07:53

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.

5条回答
  •  臣服心动
    2021-01-31 08:33

    For Mac OS X:

    system('say "beep"')
    

    Conventional print "\a" didn't always work by some reason for me (MBA, 10.7.4)

提交回复
热议问题