bool LoadWave(LPSTR szFileName)
{
FILE *f; // Handler to load the file into memory
// Open and read the wave file
f = fopen(szFileName, "rb");
if(!f)
// Error, file not found.
return true;
// Determine the file size
fseek(f, 0, SEEK_END);
file_size = ftell(f);
// Rewind the pointer to the begginning so we can read it
fseek(f, 0, SEEK_SET);
// Allocate enough memory to store the entire file
lpfile = new char [file_size];
// 'Copy' the file to memory
fread(lpfile, 1, file_size, f);
// Close the file, we won't need it anymore
fclose(f);