Discussion:
Extract Audio (PCM) data from IDirectSoundBuffer::Unlock
(too old to reply)
Alok
2010-05-18 06:22:01 UTC
Permalink
Hello,

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.
Alok
2010-05-20 07:11:01 UTC
Permalink
Hello All,

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.
Post by Alok
Hello,
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.
Loading...