Sound.h
资源名称:3DRPG.rar [点击查看]
上传用户:cjwanglu
上传日期:2013-07-10
资源大小:4744k
文件大小:1k
源码类别:
游戏
开发平台:
Visual C++
- #include <d3dx9.h>
- #include <dmusici.h>
- #include <dsound.h>
- #include <dshow.h>
- #define SafeRRelease(pInterface) if(pInterface != NULL) {pInterface->Release(); pInterface=NULL;}
- class CSound
- {
- /*private:
- LPDIRECTSOUND pDS;
- LPDIRECTSOUNDBUFFER pPBuf;
- LPDIRECTSOUNDBUFFER pSBuf;
- WAVEFORMATEX pwfmt;
- WAVEFORMATEX swfmt;
- DSBUFFERDESC dsdesc;
- MMCKINFO ckRiff;
- MMCKINFO ckInfo;
- MMRESULT mmresult;
- HMMIO hmmio;
- DWORD size;
- HRESULT result;
- LPVOID pAudio;
- DWORD bytesAudio;
- int volume;
- int pan;
- public:
- CSound(HWND hWnd,LPSTR pStr);
- virtual ~CSound();
- void Play();*/
- private:
- WCHAR wstrSoundPath[MAX_PATH];
- CHAR strSoundPath[MAX_PATH];
- enum Format {Unknown, MP3, WavMidi};
- IDirectMusicSegment8* m_pSegment;
- IDirectMusicPerformance8* m_pDirectAudioPerformance;
- IDirectMusicLoader8* m_pDirectAudioLoader;
- IGraphBuilder* m_pGraph;
- IMediaControl* m_pMediaControl;
- IMediaPosition* m_pMediaPosition;
- Format m_enumFormat;
- public:
- CSound(HWND hWnd);
- virtual ~CSound();
- void Play(int t,CHAR * pStr);
- void PlaySound(CHAR * pStr);
- };