Play a sound : Sound « Windows Platform « Ruby






Play a sound


require "win32ole"

sound = WIN32OLE.new("MCI.MMcontrol")

wav = "c:\\windows\\media\\The Microsoft Sound.wav"
sound.fileName = wav

sound.autoEnable = true

sound.command = "Open"
sound.command = "Play"

sleep 7

 








Related examples in the same category