Copied from MSDN for midi (can't find it on the online version)-
Code:
BOOL PlayMidi(char *sFileName) {
char buf[256];
sprintf(buf, "open %s type sequencer alias MUSIC", sFileName);
if (mciSendString("close all", NULL, 0, NULL) != 0)
{ return(FALSE); }
if (mciSendString(buf, NULL, 0, NULL) != 0) { return(FALSE); }
if (mciSendString("play MUSIC from 0", NULL, 0, g_hWnd) != 0)
{ return(FALSE); }
// Yahoo!
return TRUE; }
I believe you can play mp3's using DirectShow, but if this is too much work there's probably plenty of third party libraries that will play them, try searching on google.