www.pudn.com > Game_11.rar > Sound.h
#pragma once #include#include "dmusici.h" #include #pragma comment (lib,"dxguid.lib") #pragma comment (lib,"dsound.lib") #pragma comment (lib,"strmiids.lib") class CWaveMidi { private: IDirectMusicLoader8 *m_pLoader; private: IDirectMusicPerformance8 *m_pPerformance; IDirectMusicSegment8 *m_pSegment; WCHAR m_pStrSoundPath[MAX_PATH]; public: CWaveMidi(HWND); ~CWaveMidi(void); LRESULT LoadSound(char* strFileName); bool Play(DWORD dwNumOfRepeats); void SetSearchDirectory(char *strPath) { //WCHAR wstrPath[MAX_PATH]; MultiByteToWideChar(CP_ACP, 0, strPath, -1, m_pStrSoundPath, MAX_PATH); m_pLoader->SetSearchDirectory( GUID_DirectMusicAllTypes,m_pStrSoundPath,FALSE); }; };