• Advertisement
Sign in to follow this  

CSound: Reset, Play, Repeat.

This topic is 4339 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I play sound in game many times, it mutes after a while. (for example, program plays sound repeatedly while enter is pressed) Anyone has any ideas?
//Global
CSoundManager*	g_pSoundManager1 = NULL;
CSound*		g_Sound1 = NULL;

//Initialize
g_pSoundManager1 = new CSoundManager();
g_pSoundManager1->Initialize( DXUTGetHWND(), DSSCL_PRIORITY );
g_pSoundManager1->SetPrimaryBufferFormat( 2, 22050, 16 );
LPWSTR soundFileName = L"Media\\Sounds\\gun1.wav";
g_pSoundManager1->Create( &g_Sound1, soundFileName, 0, GUID_NULL );


// Game Loop
g_Sound1->Reset();
g_Sound1->Play();


(if FAILED(hr) initialization checks are removed for simplicity) [Edited by - Petar Titelski on March 29, 2006 5:03:09 AM]

Share this post


Link to post
Share on other sites
Advertisement
What is the scope of g_Soundl? Does it stop because it is deallocated? Just guessing..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement