Original Post
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? (if FAILED(hr) initialization checks are removed for simplicity) [Edited by - Petar Titelski on March 29, 2006 5:03:09 AM]
//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();