プロジェクト

全般

プロフィール

機能 #380 » mac_sound.rb

Katsuyoshi MATSUMOTO, 2011-11-24 20:54

 
1
Module.new do
2
  if command_exist? "afplay"
3
    Plugin::create(:mac_sound).add_event(:play_sound){ |filename, &stop|
4
      SerialThread.new {
5
        bg_system("afplay", filename) if FileTest.exist?(filename) }
6
      stop.call
7
    }
8
  end
9
end
(2-2/2)