I know this is more of a a general Ruby question, but it part of a script I was messing around with.
Basically I'm making a wrapper for mciSendString to invoke Windows audio library using Win32API so that I can make a replacement Audio module for XP/VX that has a lot more functions to it. All went pretty well, and most of the actual functionality is complete, I even made a little wrapper for the default Audio module so that it works with the current functions, but I ran into a bug that I have been trying to figure out for the past few hours to no avail.
What's happening is when a sound effect is played (it likely does it with everything, just stands out the most with SE), it sounds as if the file is being played twice in rapid succession, milliseconds from each other. I have stared at my code and looked at it repeatedly, and cannot see anywhere that that the file is being played twice.
If someone with a fresh set of eyes and a basic understanding of mciSendString could take a look and see what I am doing wrong, I would be most grateful. I have it set so that you can press CTRL to play the cursor SE, or simply open the menu and scroll through the options to hear what I am talking about. The majority of the code is in the Audio::Channel script, and the two method that need picked on are "open" and "play".
Here's a link to the demo.
http://www.mediafire.com/?5499pygnqkbwaaq