Is it possible to play 2 waves t the same time in "C" programming ?
I'm asking this because I'm working on a game, and I have wave sounds for almost everything, like selecting items, alerts, etc.. but I want also to play music in the background. For now if I call multiple times 'PlaySound();' it will play the sounds one at time, and doesn't pass to next sound until the first one ends, and ofcourse the game freeze until the bran stops.
Thanks..
Does pthread.h can help me doing this..as you said Use several threads or do I have to download and use openAL, maybe FMOD or SFML or XAudio2? I think is a bit complicate to accomplish this, I just watch youtube examples, and they are pretty hard to understand.. dohhh :\
Is it even possible to use them in "C" ?
There are probably many ways to handle it but I'd start by writing a program to play a single wav file - not too hard I guess - and then start modifying that for multiple threads. Of course there is software that does all that for you channel by channel with volume knobs, meters and dials - but that is not programming :(
I got it finally.. I have 2 days of reading and download a bunch of files and l decided at last to play multiple audio files with openAL.lib, which is not that simple as it show on web pages. However for me remains one problem and I did try it but loading files from resources doesn't work with openAL, I mean I tried to use MAKEINTRESOURCE(name_ID) but the program crush so the only solution is to #define FILE "name.wav" and then pass it to alutCreateBufferFromFile(const char* fileName) function and of course to carry on files in same folder with the .exe Here is a sample code: