Jump to content
  • Advertisement
Sign in to follow this  
Petar Titelski

CSound: Reset, Play, Repeat.

This topic is 4518 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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!