「Ruby入門」RubyでWindows環境に音を放送するサンプル方法

rubyコード:
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

Development

Posted by arkgame