Archived

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

miner2049er

DirectSound Problem - Short Glitches at Start of Sounds

Recommended Posts

miner2049er    122
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
thedo    124
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.

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites