@Jaseoffire, I'd highly recommend you use Fmod as your sound library. I've used it before; looping is very simple. Here's a good example on how to do it:
// ... init code
// Create a function that displays errors in case FMOD failed to do something.
template<typename funcname, typename linenumber> void errcheck(funcname function, linenumber ln, FMOD_RESULT result) {
if(result!=FMOD_OK) {
MessageBox (NULL, FMOD_ErrorString(result), "Error", MB_OK);
}
}
// Initialize FMOD
FMOD::System *system;
// Do verification, ensure our FMOD version is correct.
unsigned int version = 0;
errcheck(__func__, __LINE__, FMOD::System_Create (&system)); // Create the system object.
errcheck(__func__, __LINE__, system->getVersion(&version)); // Get the version of FMOD we're running.
if (version<FMOD_VERSION) {
MessageBox (NULL, "The sound system version is less than the required version.", "Error", MB_OK);
}
// Initialize the audio system with 4093 virtual channels.
errcheck(__func__, __LINE__, system->init(4093, FMOD_INIT_NORMAL, (void*)0));
// Load a new sound, let's call it music.ogg.
FMOD::Sound *sound;
errcheck(__func__, __LINE__, system->createSound("music.ogg", FMOD_DEFAULT, 0, &sound));
sound->setMode(FMOD_LOOP_NORMAL);
// Play the sound.
FMOD::Channel *channel=0; // This is the channel we're going to be playing the sound on.
// Now, play our sound on this channel.
errcheck(__func__, __LINE__, system->playSound("music.ogg", 0, false, &channel));
// Set the sound volume to a lower volume so it doesn't blow out our ears! :)
errcheck(__func__, __LINE__, channel->setVolume(0.50));
// And then, when you want to unload the sound...
errcheck(__func__, __LINE__, channel->stop());
errcheck(__func__, __LINE__, sound->release());
// And now, release the system.
errcheck(__func__, __LINE__, system->close());
errcheck(__func__, __LINE__, system->release());
That's all! It may seem like a lot of code, but in C/C++ you do this kind of thing every day. You could certainly trivialize this into functions, too.
"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." — Charles Babbage.
My Github