Const
    MAXPNAMELEN = 32;
    MAXERRORLENGTH = 256;
    MAX_JOYSTICKOEMVXDNAME = 260;
    MM_MIDI_MAPPER = 1;
    MM_WAVE_MAPPER = 2;
    MM_SNDBLST_MIDIOUT = 3;
    MM_SNDBLST_MIDIIN = 4;
    MM_SNDBLST_SYNTH = 5;
    MM_SNDBLST_WAVEOUT = 6;
    MM_SNDBLST_WAVEIN = 7;
    MM_ADLIB = 9;
    MM_MPU401_MIDIOUT = 10;
    MM_MPU401_MIDIIN = 11;
    MM_PC_JOYSTICK = 12;
    TIME_MS = 1;
    TIME_SAMPLES = 2;
    TIME_BYTES = 4;
    TIME_SMPTE = 8;
    TIME_MIDI = 16;
    TIME_TICKS = 32;

    MM_MCINOTIFY = $3B9;
    MM_WOM_OPEN = $3BB;
    MM_WOM_CLOSE = $3BC;
    MM_WOM_DONE = $3BD;
    MM_WIM_OPEN = $3BE;
    MM_WIM_CLOSE = $3BF;
    MM_WIM_DATA = $3C0;
    MM_MIM_OPEN = $3C1;
    MM_MIM_CLOSE = $3C2;
    MM_MIM_DATA = $3C3;
    MM_MIM_LONGDATA = $3C4;
    MM_MIM_ERROR = $3C5;
    MM_MIM_LONGERROR = $3C6;
    MM_MOM_OPEN = $3C7;
    MM_MOM_CLOSE = $3C8;
    MM_MOM_DONE = $3C9;
    MM_DRVM_OPEN = $3D0;
    MM_DRVM_CLOSE = $3D1;
    MM_DRVM_DATA = $3D2;
    MM_DRVM_ERROR = $3D3;
    MM_STREAM_OPEN = $3D4;
    MM_STREAM_CLOSE = $3D5;
    MM_STREAM_DONE = $3D6;
    MM_STREAM_ERROR = $3D7;
    MM_MOM_POSITIONCB = $3CA;
    MM_MCISIGNAL = $3CB;
    WAVE_INVALIDFORMAT = 0;
    WAVE_FORMAT_1M08 = 1;
    WAVE_FORMAT_1S08 = 2;
    WAVE_FORMAT_1M16 = 4;
    WAVE_FORMAT_1S16 = 8;
    WAVE_FORMAT_2M08 = 16;
    WAVE_FORMAT_2S08 = 32;
    WAVE_FORMAT_2M16 = 64;
    WAVE_FORMAT_2S16 = 128;
    WAVE_FORMAT_4M08 = 256;
    WAVE_FORMAT_4S08 = 512;
    WAVE_FORMAT_4M16 = $400;
    WAVE_FORMAT_4S16 = $800;
    MM_MIM_MOREDATA = $3CC;
    MM_MIXM_LINE_CHANGE = $3D0;
    MM_MIXM_CONTROL_CHANGE = $3D1;
    MMSYSERR_BASE = 0;
    WAVERR_BASE = 32;
    MIDIERR_BASE = 64;
    TIMERR_BASE = 96;
    JOYERR_BASE = 160;
    MCIERR_BASE = 256;
    MIXERR_BASE = 1024;
    MCI_STRING_OFFSET = 512;
    MCI_VD_OFFSET = 1024;
    MCI_CD_OFFSET = 1088;
    MCI_WAVE_OFFSET = 1152;
    MCI_SEQ_OFFSET = 1216;
    MMSYSERR_NOERROR = 0;
    MMSYSERR_ERROR = (MMSYSERR_BASE+1);
    MMSYSERR_BADDEVICEID = (MMSYSERR_BASE+2);
    MMSYSERR_NOTENABLED = (MMSYSERR_BASE+3);
    MMSYSERR_ALLOCATED = (MMSYSERR_BASE+4);
    MMSYSERR_INVALHANDLE = (MMSYSERR_BASE+5);
    MMSYSERR_NODRIVER = (MMSYSERR_BASE+6);
    MMSYSERR_NOMEM = (MMSYSERR_BASE+7);
    MMSYSERR_NOTSUPPORTED = (MMSYSERR_BASE+8);
    MMSYSERR_BADERRNUM = (MMSYSERR_BASE+9);
    MMSYSERR_INVALFLAG = (MMSYSERR_BASE+10);
    MMSYSERR_INVALPARAM = (MMSYSERR_BASE+11);
    MMSYSERR_HANDLEBUSY = (MMSYSERR_BASE+12);
    MMSYSERR_INVALIDALIAS = (MMSYSERR_BASE+13);
    MMSYSERR_BADDB = (MMSYSERR_BASE+14);
    MMSYSERR_KEYNOTFOUND = (MMSYSERR_BASE+15);
    MMSYSERR_READERROR = (MMSYSERR_BASE+16);
    MMSYSERR_WRITEERROR = (MMSYSERR_BASE+17);
    MMSYSERR_DELETEERROR = (MMSYSERR_BASE+18);
    MMSYSERR_VALNOTFOUND = (MMSYSERR_BASE+19);
    MMSYSERR_NODRIVERCB = (MMSYSERR_BASE+20);
    MMSYSERR_LASTERROR = (MMSYSERR_BASE+20);
    MM_JOY1MOVE = $3A0;
    MM_JOY2MOVE = $3A1;
    MM_JOY1ZMOVE = $3A2;
    MM_JOY2ZMOVE = $3A3;
    MM_JOY1BUTTONDOWN = $3B5;
    MM_JOY2BUTTONDOWN = $3B6;
    MM_JOY1BUTTONUP = $3B7;
    MM_JOY2BUTTONUP = $3B8;
    CALLBACK_TYPEMASK = $70000;
    CALLBACK_NULL = 0;
    CALLBACK_EVENT = $50000;
    CALLBACK_WINDOW = $10000;
    CALLBACK_TASK = $20000;
    CALLBACK_THREAD = CALLBACK_TASK;
    CALLBACK_FUNCTION = $30000;

Const
    DRV_LOAD = 1;
    DRV_ENABLE = 2;
    DRV_OPEN = $3;
    DRV_CLOSE = 4;
    DRV_DISABLE = $5;
    DRV_FREE = $6;
    DRV_CONFIGURE = $7;
    DRV_QUERYCONFIGURE = 8;
    DRV_INSTALL = $9;
    DRV_REMOVE = $A;
    DRV_EXITSESSION = $B;
    DRV_POWER = $F;
    DRV_RESERVED = $800;
    DRV_USER = $4000;
    DRVCNF_CANCEL = 0;
    DRVCNF_OK = 1;
    DRVCNF_RESTART = 2;
    DRV_CANCEL = DRVCNF_CANCEL;
    DRV_OK = DRVCNF_OK;
    DRV_RESTART = DRVCNF_RESTART;
    DRV_MCI_FIRST = DRV_RESERVED;
    DRV_MCI_LAST = (DRV_RESERVED+$FFF);

const
    SND_NODEFAULT = 2;
    SND_MEMORY = 4;
    SND_LOOP = 8;
    SND_NOSTOP = 16;
    SND_SYNC = 0;
    SND_ASYNC = 1;
    SND_PURGE = 64;
    SND_APPLICATION = 128;
    SND_ALIAS_START = 0;
    SND_ALIAS_SYSTEMHAND = 18515;
    SND_ALIAS_SYSTEMEXCLAMATION = 8531;
    SND_ALIAS_SYSTEMASTERISK = 10835;
    SND_ALIAS_SYSTEMQUESTION = 16211;
    SND_ALIAS_SYSTEMDEFAULT = 17491;
    SND_ALIAS_SYSTEMEXIT = 17747;
    SND_ALIAS_SYSTEMSTART = 21331;
    SND_ALIAS_SYSTEMWELCOME = 22355;
    SND_NOWAIT = $2000;
    SND_ALIAS = $10000;
    SND_ALIAS_ID = $110000;
    SND_FILENAME = $20000;
    SND_RESOURCE = $40004;
    WAVERR_BADFORMAT = (WAVERR_BASE+0);
    WAVERR_STILLPLAYING = (WAVERR_BASE+1);
    WAVERR_UNPREPARED = (WAVERR_BASE+2);
    WAVERR_SYNC = (WAVERR_BASE+3);
    WAVERR_LASTERROR = (WAVERR_BASE+3);
    WOM_OPEN = MM_WOM_OPEN;
    WOM_CLOSE = MM_WOM_CLOSE;
    WOM_DONE = MM_WOM_DONE;
    WIM_OPEN = MM_WIM_OPEN;
    WIM_CLOSE = MM_WIM_CLOSE;
    WIM_DATA = MM_WIM_DATA;
    WAVE_MAPPER = UINT(-1);
    WAVE_FORMAT_QUERY = 1;
    WAVE_ALLOWSYNC = 2;
    WAVE_MAPPED = 4;
    WAVE_FORMAT_DIRECT = 8;
    WAVE_FORMAT_DIRECT_QUERY = (WAVE_FORMAT_QUERY Or WAVE_FORMAT_DIRECT);
    MIM_OPEN = MM_MIM_OPEN;
    MIM_CLOSE = MM_MIM_CLOSE;
    MIM_DATA = MM_MIM_DATA;
    MIM_LONGDATA = MM_MIM_LONGDATA;
    MIM_ERROR = MM_MIM_ERROR;
    MIM_LONGERROR = MM_MIM_LONGERROR;
    MOM_OPEN = MM_MOM_OPEN;
    MOM_CLOSE = MM_MOM_CLOSE;
    MOM_DONE = MM_MOM_DONE;
    MIM_MOREDATA = MM_MIM_MOREDATA;
    MOM_POSITIONCB = MM_MOM_POSITIONCB;
    MIDIMAPPER = UINT(-1);
    MIDI_MAPPER = UINT(-1);
    MIDI_IO_STATUS = 32;
    MIDI_CACHE_ALL = 1;
    MIDI_CACHE_BESTFIT = 2;
    MIDI_CACHE_QUERY = 3;
    MIDI_UNCACHE = 4;
    WHDR_DONE = 1;
    WHDR_PREPARED = 2;
    WHDR_BEGINLOOP = $4;
    WHDR_ENDLOOP = $8;
    WHDR_INQUEUE = $10;
    MOD_MIDIPORT = 1;
    MOD_SYNTH = 2;
    MOD_SQSYNTH = 3;
    MOD_FMSYNTH = 4;
    MOD_MAPPER = 5;
    MOD_WAVETABLE =  6;  { hardware wavetable synth }
    MOD_SWSYNTH   =  7;  { software synth }
    MIDICAPS_VOLUME = 1;
    MIDICAPS_LRVOLUME = 2;
    MIDICAPS_CACHE = 4;
    MIDICAPS_STREAM = 8;
    MHDR_DONE = 1;
    MHDR_PREPARED = 2;
    MHDR_INQUEUE = $4;
    MHDR_ISSTRM = $8;
    MEVT_F_SHORT = 0;
    MEVT_F_LONG = $80000000;
    MEVT_F_CALLBACK = $40000000;

function sndPlaySoundA(Name: LPCSTR; flags: UINT): BOOL; stdcall; external 'winmm.dll' name 'sndPlaySoundA';

procedure TAudio.OnInit;
begin
end;

procedure TAudio.OnDone;
begin
end;

procedure TAudio.PlayFile(const Filename: String);
begin
  sndPlaySoundA(PAnsiChar(Filename), SND_FILENAME or SND_ASYNC or SND_NODEFAULT);
end;

function TAudio.LoadSound(const Filename: String): TSound;
begin
  Result := Filename;
end;

procedure TAudio.FreeSound(Sound: TSound);
begin
end;

procedure TAudio.Play(Sound: TSound);
begin
  PlayFile(Sound); // dirty hack XD
end;

procedure TAudio.SetSoundVolume(Volume: Single);
begin
end;

function TAudio.IsPlaying(Sound: TSound): Boolean;
begin
  Result := False;
end;
