I would check out SDL. They have a library that is called SDL_mixer that can do this. http://www.libsdl.org