Jump to content
Sign in to follow this  
larcerkev

Play a sound or something without delay?

Recommended Posts

larcerkev

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 this post


Link to post
Share on other sites
czardas

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 this post


Link to post
Share on other sites
monoscout999

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

Share this post


Link to post
Share on other sites
smashly

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 this post


Link to post
Share on other sites
JohnOne

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

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
larcerkev

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.