Question for CreateInMemoryWaveBank
I want to load *.xwb file,
this function is from "XBUtil.h"
HRESULT XBUtil_LoadFile( const WCHAR* strFile, VOID** ppFileData, DWORD* pdwSize )
{// use as big as file size memory
"CreateFile" and get file size to "malloc" buffet and go to "ReadFile" and CreateInMemoryWaveBank
}
and next is sample from Microsoft DirectX SDK (June 2006)\Samples\C++\XACT\XACTGame\
void FunctionForLoadWaveBank()
{//won't use many memory
hFile = CreateFile( str, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL );
dwFileSize = GetFileSize( hFile, NULL );
hMapFile = CreateFileMapping( hFile, NULL, PAGE_READONLY, 0, dwFileSize, NULL );
pbWaveBank = MapViewOfFile( hMapFile, FILE_MAP_READ, 0, 0, 0 );
hr = pEngine->CreateInMemoryWaveBank( pbWaveBank, dwFileSize, 0, 0, &pWaveBank );
CloseHandle( hMapFile );
CloseHandle( hFile );
}
why get different memory volume
when I load File and those function for
Microsoft DirectX SDK (June 2006)\Samples\C++\XACT\XACTGame\media\audiodroid.xwb
what different between FunctionForLoadWaveBank and XBUtil_LoadFile
thx for any reply
PS: I have no idea within CreateFileMapping and MapViewOfFile.....

