And if you want to test out the code, here's an overly simlified AUD decoder. It'll only play one song and then stop playing music. (But it does stop gracefully with silence and doesn't just stutter continuously at the end). Basically, it lacks any sort of playlist control. Well, here's the 6 files that do it.
AudPlayer.h
--------------
#include "MusicHook.h"
int __stdcall FillMusicBuffer(char *musicBuffer, int bufferSize);
AudPlayer.cpp
-----------------
#include "MusicHook.h"
#include "AudFileReader.h"
#include "AudDecoder.h"
AudFileReader.h
--------------------
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <fstream.h>
class AudFileReader
{
public:
AudFileReader();
~AudFileReader();
int Open(char *fileName);
AudFileReader.cpp
----------------------
#include "AudFileReader.h"
AudFileReader::AudFileReader()
{
hFile = INVALID_HANDLE_VALUE;
currentChunkOffset = 0;
memset(&audHeader, 0, sizeof(audHeader));
memset(¤tChunkHeader, 0, sizeof(currentChunkHeader));
}
AudFileReader::~AudFileReader()
{
AudDecoder.h
-----------------
class AudDecoder
{
public:
AudDecoder();
int Decode(void *pcmBuffer, int pcmBufferSize, char *audBuffer, int audBufferSize);
private:
AudDecoder.cpp
-------------------
Ohh, but now I've gone and spilled the beans!

I'm not sure if I even told Eddy what I was doing with my hooking code. But there it is. My custom built .Aud decoder. It was based off of some file I found on the internet about the music in Dune 2000. It used AD-PCM (Adaptive Pulse Code Modulation) to encode each 16 bit sample as 4 bits. Lossy compression of course. Anyways, I wanted to make a "sandbox" level using the Dune 2000 maps, and figured it wouldn't be complete without the music (and sand worms!

).
Anyways, I imported the Dune 2000 tile sets into Outpost2 format and a bunch of the multiplayer maps as well. I think there was around 25 something odd maps or so. I can't remember anymore. I think there were bugs in at least two maps that caused crashes. Anyways, I did that well over a year ago, and still haven't got around to making any levels, so I guess it's safe to say I'll never get around to it. So don't get your hopes up and expect this to ever be finished. The project has essentially been abandoned for a rather long time now. Oh, and I never added OP2 specific tiles to the Dune2000 tile set. Namely the tubes, walls, and bulldozed terrain, along with rubble (common and rare) and marks left on the ground from vehicle explosions. (Yes Haxtor, that's the secret project I tried to get you to help me with so very long ago).
Oh, and my work on importing the Dune 2000 tileset is what lead me to start on the project that became the map editor backend. I was mainly interested in the tile sets at the time, but the tile sets and the map format are so closely tied together in OP2 that I ended up doing so much work on the map files that I figured Hacker could make use of it for a map editor.
Of course adding new units into OP2 is damn near impossible, so adding sand worms just never came close. Although I did learn a fair bit about the OP2 unit system and I'd say it's somewhat possible to add new units in limited ways if you really wanted to work hard. I never quite learned everything I would have needed, but it was enough that I'd have some idea where to go.
Anyways, the music part worked, aside from the playlist. (And the base tileset was imported nicely). Enjoy.