I have an Application which extract PCM data from two buffers of
IDirectSoundBuffer::Unlock method.
I dumped this audio data and add WAVE Header, and when I play it, a lot of
noises and glitches can be heard.
Currently I am dumping audio data in following sequence.
1. from first buffer of UnLock method.
2. then from second buffer of UnLock method.
Please suggest how can I remove these noises and glitches from this dumped
data.
Syntax of IDirectSoundBuffer::Unlock is
Unlock(pvAudioPtr1,dwAudioBytes1,pvAudioPtr2,dwAudioBytes2)
where,
pvAudioPtr1 & pvAudioPtr2 are pointers to the buffers and dwAudioBytes1 n
dwAudioBytes2 are the size of corresponding buffers.
As per documentation on MSDN the size of valid audio data stored in these
buffers are same as that of dwAudioBytes1 & dwAudioBytes2 .
But when I debugged these buffers, I found that they conatins lot of
unwanted garbage or silence data.
Can any one suggest how to extract only the valid audio data from these
buffers.