Play a sound or something without delay?

Recommended Posts

I was wondering if there was a way to play an audio file or a simple Beep without having a delay in the script and having it loop over itself if there was a massive amount of plays.

I tried something like repeating Beep(1700,20) for about 20 times within a second and the beeps become delayed and are played out longer then they should be.

Edit: SoundPlay() makes the script freeze after a few plays of the sound file.

Edited by larcerkev

Share on other sites

If you want simultaneous sounds you could try to do something with midi. Here's the original

You can play sounds simultaneously using _MidiOutShortMsg() but you cannot duplicate the same frequency. If you have 440 Hz on flute and then you want to add 440 Hz on violin, the flute will be cancelled out. If you use different frequencies, that doesn't happen.

You might want to look at one of my creations using a small set of functions from the original midi UDF in this thread: The chimes are sounds that fade naturally. You will probably want to select a different type of instrument, if you wish to have a continuous sound. You can stop any particular frequency at any moment you choose. It might require some study.

Share on other sites

I use The Bass.Dll with a multitrack proyect I'm working on, i dont do test with an overload CPU usage, but for short sounds it works perfectly.

Share on other sites

Hi,

I use irrKlang with AutoIt, to run multiple sounds at the same time.

Bass.dll, is good, but I notice it seems to skip a sound if it can't keep up.

eg: in an autoit game I wrote I wanted a sound to be played every time I fired the button no matter how fast I click the button, even if the sound was already playing and in use, play it again at the same time even if other shooting sounds hadn't finished.

Bass.dll started to skip the shot sound by the 4th rapid press of the shot button.

irrKlang happily played the sound no mater how fast or how many times I pressed the button and just didn't skip a beat.

For an example of irrKlang shot sound I mentioned then you could look at

Cheers

Share on other sites

I dont have problems with bass,dll, but IrrKlang sound intersting

Here you got a rar file that contains a snippet of what i am working on.

Share on other sites

I imagine you could use sndrec32.exe if you are using winXP

Something like

$sExe = "C:\Windows\system32\sndrec32.exe /play C:\my\path\to\wav.wav" Run($sExe)`

Unfortunately Its not in vista or 7, and I dont know if its available to download or if it even works on them.

Edited by JohnOne

Monkey's are, like, natures humans.

Share on other sites

I was finally able to get BASS to play my file and it seems to work just fine. Thank you all for your suggestions and ideas.

Create an account

Register a new account