Re: How to copy source/data of LDIRECTSOUNDBUFFER to LDIRECTSOUNDBUFFER8 variable.

Thanks , i can capture and add effect then playback at the same time. I use

But i have other question: i see that the demo have a delay time between i
say into microphone and playback to device. delay time about 120 - 140
miliseconds. Can you show me the reason?
And can you help me fix this, i would like to "say and hear" are realtime
or decrease time delay?

Thanks for your help.

"Chris P. [MVP]" <msdn@xxxxxxxxxxxx> wrote in message
On Sat, 9 Sep 2006 16:23:58 +0700, Paul wrote:

Directsound have two samples: One is soundFX and other is DuplexFilter
In soundFX, the app used LDIRECTSOUNDBUFFER8 with purpose are using
But in DuplexFilter, app used LDIRECTSOUNDBUFFER for capture and
at the same time.
Now , I would like to combine two sample. I would like to capture and
effect and playback sound ( my voice through microphone) at the same
Can i do this?

I have tried to do as follow:
first i will have m_pDSBCapture, a capture sound buffer, (from my voice)
with type is LDIRECTSOUNDBUFFER and m_pDSBOutput, a output sound buffer,
same type. I also have a m_pDSB8 with type is LDIRECTSOUNDBUFFER8 .
Now, i want to copy data from m_pDSBCapture or m_pDSBOutput to m_pDSB8
that i can call setFX and Play function for m_pDSB8 . How can i do
I call m_pDSBOutput->QueryInterface( IID_IDirectSoundBuffer8, (LPVOID*)
&m_pDSB8 ) ) ) then is failed.

Can anyone show me solution? Do you have sample source do this?

Well error codes returned are always useful. What error does it give you?

IDirectSoundBuffer8 replaces IDirectSoundBuffer and is all you need to
but you do have to query interface on the IDirectSoundBuffer returned from
CreateBuffer() to get it.

if( FAILED( hr = m_pDS->CreateSoundBuffer( &dsbd, &pDSBuffer, NULL ) ) )
return DXTRACE_ERR_MSGBOX( TEXT("CreateSoundBuffer"), hr );
if( FAILED( hr = pDSBuffer->QueryInterface( IID_IDirectSoundBuffer8,
(VOID**)&m_pDSBOutput ) ) )
return DXTRACE_ERR_MSGBOX( TEXT("QueryInterface"), hr );



Relevant Pages

  • Re: Sound recording - HELP!
    ... maybe this would be a great app to get my ... listing on the radio. ... Private Sub StartRecording() ... mciSimpleSendString("open new type waveaudio alias capture") ...
  • RE: Strange behavior of redirected stdout. Streams Broken?
    ... I can capture stderr and stdout from a console app. ...
  • Re: Captureing device error: "Busy
    ... Can you show me how to locate the app in MCE? ... >>> I have the same error message when I tired to capture analog video ... >>> the video and sound from my VCR. ...
  • Re: Windows media encoder
    ... Each running app will place an Icon here ... maybe causing a conflict with your capture software: ... Did you open Windows Task Manager? ... Running Processes and CPU Usage. ...
  • SetCapture, mouse and key events
    ... turns on drawing, and the second mouse click turns it off. ... Capture property would make sure the window gets all mouse messages until ... I'm just experimenting with this app; ...