|
Answer» One of my friends came to me for assistance with a game he is making. He wants to have BACKGROUND audio for his game that is written in C++ that will loop, but he is having problems.
While I know how to tell C++ to load and play an audio file as a wave file ( in an older C++ book ), this is an aspect of C++ that I have very little knowledge with as for almost all books I have used touch on EVERYTHING really well to understand the concepts etc, and what loops are better than others for the desired END result etc, except for Sound and Graphics are always a weak subject in all the books that I have. I have one book that shows examples on how to load and play wave files, but getting the wave files to loop is something the book doesnt touch on, as well as how to have this audio RUN as a thread off of the main program without the main program waiting for the audio file to end before moving on to the next instruction is something I have never done myself.
Anyone know of any good books or website references for dealing with Audio Playback and C++, other than playing a wave file only once or making the computer beep that I can share with him?
Thanksuse a library.
Either that or use another low LEVEL library such as OpenAL or DirectSound. Looping would then be implemented by a callback method that is invoked when the Sound Buffer is about to be exhausted, and logic would place the correct data into the buffer to continue playing sound. Thanks for info BC... I shared link to this forum with him to check out and read further at un4seen.com
|