> -----Original Message----- > From: Gordon Thiesfeld [mailto:gthiesfeld / gmail.com] > Sent: 15 May 2007 15:45 > To: ruby-talk ML > Subject: Re: sleep 0.2 acts more like sleep 1 > > 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. > > <code> > require "win32/sound" > include Win32 > > wav = "c:\\windows\\media\\chimes.wav" > > Sound.play(wav,Sound::ASYNC|Sound::LOOP) > sleep 3 > Sound.stop > > </code> > > Hope it helps. > > Gordon It would also make sense to me to use a longer sound file. A 3 second sound file containing 15 beeps, or something.. Seems a little less like brute force to me, playing the sound only 4 or 5 times in 15 seconds, or something. Just my 2p.