3DSound.h
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:1k
- #ifndef _3DSOUND_
- #define _3DSOUND_
- #define TRY_DS(exp) { { HRESULT rval = exp; if (rval != DS_OK) { TraceErrorDS(rval, __FILE__, __LINE__); return FALSE; } } }
- typedef struct _WaveHeader
- {
- BYTE RIFF[4];
- DWORD dwSize;
- BYTE WAVE[4];
- BYTE fmt_[4];
- DWORD dw16;
- WORD wOne_0;
- WORD wChnls;
- DWORD dwSRate;
- DWORD BytesPerSec;
- WORD wBlkAlign;
- WORD BitsPerSample;
- BYTE DATA[4];
- DWORD dwDSize;
- }WaveHeader;
- void D3DSoundRelease();
- void PlayRandomWave();
- BOOL StopAllSounds();
- BOOL PlaySoundDS(DWORD dwSound,D3DVECTOR d3dvPos, DWORD dwFlags);
- BOOL CreateSoundBuffer(DWORD dwBuf, DWORD dwBufSize, DWORD dwFreq, DWORD dwBitsPerSample, DWORD dwBlkAlign, BOOL bStereo);
- BOOL CreateBufferFromWaveFile(char* FileName, DWORD dwBuf);
- void TraceErrorDS(HRESULT hErr, char *sFile, int nLine);
- void RegError(char * sErr);
- BOOL InitSound();
- IDirectSoundBuffer* CreateSoundBuffer3D();
- BOOL ReadData(LPDIRECTSOUNDBUFFER lpDSB, FILE* pFile, DWORD dwSize, DWORD dwPos);
- #endif