require "Win32API" #play a file :-) SND_MEMORY = 0x00000004 # from "mmsystem.h" SND_FILENAME = 0x00020000 # PlaySound = Win32API.new("winmm", "PlaySound", ['P', 'L', 'L'], 'I') while true sleep 30 PlaySound.call("D:/xaraya.wav", 0, SND_FILENAME) puts '***' end # play from file: # play from memory: #wav = File.open("C:/your/sound.wav", File::RDONLY) {|f| f.binmode; f.read } #PlaySound.call(wav, 0, SND_MEMORY)