dxut 中CSound用法

CSound* g_apSoundsTiny ;

CSoundManager* m_pSM = new CSoundManager;


    m_pSM->Initialize( DXUTGetHWND(), DSSCL_PRIORITY );

    HRESULT hr;
    WCHAR sPath[ MAX_PATH ];


    hr = DXUTFindDXSDKMediaFileCch( sPath, MAX_PATH, L"MusicMono.wav" );
    if( FAILED( hr ) )
        wcscpy_s( sPath, MAX_PATH, L"MusicMono.wav"  );

    hr = m_pSM->Create( &g_apSoundsTiny, sPath, DSBCAPS_CTRLVOLUME );


    if( FAILED( hr ) )
        OutputDebugString(  L" not found; continuing without sound.\n" );
 
    g_apSoundsTiny->Play();


你可能感兴趣的:(Path)