Is there a function that is somewhere between playsound() and Beep()?
I'm wanting a function that you can output a sound without causing a lag in message loops, but generates the noise that you code for like beep does. (so you don't need to include a sound file to your program for download/install)
Or maybe a way to create a sound file through code alone...
Is there anything like a device context for audio?
so, while i am new to windows programming, i think i have a solution. so if the problem is the sound itself stops everything else, you can run it in a thread
Or maybe a way to create a sound file through code alone...
Is there anything like a device context for audio?
What you're describing is PCM streaming. You generate the audio samples yourself in code and stream them out to the user.
As I previously mentioned, this can be done with the waveOut series of functions. Another option is going with other libs like OpenAL, BASS, Fmod, or one of the countless others.
But if all you want to do is load a single file and play it without blocking... you can still use PlaySound. Just specify the non-blocking option, SND_ASYNC: