Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


DirectSound Problem - Short Glitches at Start of Sounds

This topic is 6153 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

Hello: I''m having problems with my sounds having small glitches at the start of them. Here''s some more details: I''m using about eight different 22.05 KHz, 8-bit sounds in my app - some play at the same time as others, and sometimes they don''t. This is how I load each of my eight sounds... LPDIRECTSOUNDBUFFER pSoundBufferExplode; LPDIRECTSOUNDBUFFER pSoundBufferBleep; pSoundBufferExplode = loadSoundBuffer(lpds, "WAVE_ID_EXPLODE"); pSoundBufferBleep = loadSoundBuffer(lpds, "WAVE_ID_BLEEP"); ...etc. loadSoundBuffer() is a function that fills my secondary sound buffer with WAV data from a resource in the EXE. I use the usual calls to play and stop each sound: ->SetCurrentPosition(0); ->Play(0,0,0); ->Stop(); At first, sounds will play fine, (so the WAV data got into the secondary buffer OK), but later, after one of the other sounds get played, the original sound will now have some glitch at the beginning (which is a brief fraction from one of the other sounds.) I haven''t been able to establish a pattern, but the problem isn''t random, as the same sound will always be affected by a glitch every time the app is executed. BUT - and here''s the weird thing - the sound that gets affected will change, if I shuffle the order of loading/creating the sound buffers i.e. I load sound A then sound B then sound C, and then I change it to loading sound C first, then sound A then sound B etc. None of the sounds are continuous. The problem happens with two different sound cards. I''m using DirectX 8 with Windows 2000 service pack 2. I''ve tried many possible remedies without success - starting and ending my waveforms at zero, adding a few milliseconds of silence to the start and end, and making them an even number of bytes. Is there anything else I should be doing - such as making sounds a certain multiple of bytes, or giving them a certain alignment when loaded? Any advice would be appreciated. Thanks in advance, and Happy Holidays! Simon.

Share this post

Link to post
Share on other sites
I have some code which i wrote in directx7 which you can have if you like - it''s not the best code in the world but if may (or may not) help. It has no problem on my machine (with Audigy Soundcard).

E-mail me if you want it.



Share this post

Link to post
Share on other sites

  • 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!