H3R0:
You have to make sure to link the library.
Project->Settings...(Link tab), then under
Object/Libraray modules, add winmm.lib
Here's the code for getting the wave header info,
and the wave sample data...my playback code is very
long and is not using typical playback methods. I hope this helps...
short* WavFileToArray(CString ptr, long *size)
{
HMMIO hmmio;
// for the Group Header
MMCKINFO mmckinfoParent;
// for finding chunks within the Group
MMCKINFO mmckinfoSubchunk;
// for reading a fmt chunk's data
WAVEFORMATEX waveFormat;
DWORD WaveDataSize;
short *track = NULL;
if (!(hmmio = mmioOpen(ptr.GetBuffer(ptr.GetLength()), 0, MMIO_READ|MMIO_ALLOCBUF)))
AfxMessageBox("Error opening the .WAV file!\n"

;
else
{
mmckinfoParent.fccType = mmioFOURCC('W', 'A', 'V', 'E');
if (mmioDescend(hmmio, (LPMMCKINFO)&mmckinfoParent, 0, MMIO_FINDRIFF))
printf("ERROR: This file doesn't contain a WAVE!\n"

;
else
{
mmckinfoSubchunk.ckid = mmioFOURCC('f', 'm', 't', ' ');
if (mmioDescend(hmmio, &mmckinfoSubchunk, &mmckinfoParent, MMIO_FINDCHUNK))
printf("ERROR: Required fmt chunk was not found!\n"

;
else
{
if (mmioRead(hmmio, (HPSTR)&waveFormat, mckinfoSubchunk.cksize) != (LRESULT)mmckinfoSubchunk.cksize)
printf("ERROR: reading the fmt chunk!\n"

;
else
mmioAscend(hmmio, &mmckinfoSubchunk, 0);
}
mmckinfoSubchunk.ckid = mmioFOURCC('d', 'a', 't', 'a');
if (mmioDescend(hmmio, &mmckinfoSubchunk, &mmckinfoParent, MMIO_FINDCHUNK))
printf("An erroring reading the data chunk!\n"

;
else
{
WaveDataSize = mmckinfoSubchunk.cksize;
*size = (long)WaveDataSize;
track = new short[*size];
mmioRead(hmmio, (char *)track, *size);
}
}
mmioClose(hmmio, 0);
}
return track;
}