From: Richard Date: 2007-05-23T05:00:16+09:00 Subject: Re: sleep 0.2 acts more like sleep 1 Hi Gordon, That's perfect for my purposes: 1. Achieving looping within the playing mechanism is much faster than using a Ruby loop invoking a Win32 function repeatedly 2. Using an explicit rather than symbolic path is also a speedup, i.e. "F:\\WINXPPRO\\media\\chimes.wav" instead of ALARM_BELL = ENV["WINDIR"] + "\\Media\\chimes.wav" Thank you very much for the addition post. Best wishes, Richard On May 15, 10:41 am, Gordon Thiesfeld wrote: > If I understand your question, you want to play a wav file repeatedly, > as quickly as possible. This code is from the example file in the > win32-sound gem. It plays chimes.wav 5 times in 3 seconds on both of > my XP machines. > > > require "win32/sound" > include Win32 > > wav = "c:\\windows\\media\\chimes.wav" > > Sound.play(wav,Sound::ASYNC|Sound::LOOP) > sleep 3 > Sound.stop > > > > Hope it helps. > > Gordon