Dark Bit Factory & Gravity
PROGRAMMING => C / C++ /C# => Topic started by: SilentWorld on July 26, 2021
-
As the title says, is there any way at all to do this using the default Win32 API? I know that PlaySound is ancient and can't do sound mixing. I am currently using it just to play looping background music which works perfectly. I have read a little about DirectSound, but that has been deprecated for a long time and is even lower level than PlaySound. Basically, I need something lightweight that can be statically linked to play WAVs. I have read in a couple of places that using MCISendString allows multiple sounds to be played, but the code is always in VB.
Link: https://social.msdn.microsoft.com/Forums/en-US/6082e245-d38e-4ba0-a6ff-445186d7ca74/play-parallel-sounds?forum=vblanguage
-
What about using WAV buffers and some code like the player of a very basic sofware synth (mixing multiply samples) - and using waveOutOpen() API for output?
-
What about using WAV buffers and some code like the player of a very basic sofware synth (mixing multiply samples) - and using waveOutOpen() API for output?
Thanks for the suggestion. I looked into it, but there aren't many examples I could find, and my usage here is in a very simple context. It looks to be easier for me to extract the WAV files from the exe as temp data and use MCISendString to play them. Ideally all the data should be loaded from the executable.
-
not sure if this is what we are talking about... havent looked into the sources... just a fast found....
http://alax.info/trac/public/browser/trunk/Utilities/WaveOutMultiPlay (http://alax.info/trac/public/browser/trunk/Utilities/WaveOutMultiPlay)