|Microsoft DirectX 9.0|
The DuplicateSoundBuffer method creates a new secondary buffer that shares the original buffer's memory.
HRESULT DuplicateSoundBuffer( LPDIRECTSOUNDBUFFER pDSBufferOriginal, LPDIRECTSOUNDBUFFER * ppDSBufferDuplicate );
Address of the IDirectSoundBuffer or IDirectSoundBuffer8 interface of the buffer to duplicate.
Address of a variable that receives the IDirectSoundBuffer interface pointer for the new buffer.
If the method succeeds, the return value is DS_OK.
If the method fails, the return value may be one of the following error values:
This method is not valid for buffers created with the DSBCAPS_CTRLFX flag.
Initially, the duplicate buffer will have the same parameters as the original buffer. However, the application can change the parameters of each buffer independently, and each can be played or stopped without affecting the other.
The buffer memory is released when the last object referencing it is released.
Header: Declared in dsound.h.