Microsoft DirectX 8.1 (Visual Basic)

DirectSound8.DuplicateSoundBuffer

The DuplicateSoundBuffer method creates a new secondary buffer that duplicates or shares the original buffer's memory.

This method is deprecated. Duplicate buffers do not share memory on most systems, and effects set on the original buffer are not set on the duplicate.

Syntax

object.DuplicateSoundBuffer( _
  original As DirectSoundSecondaryBuffer8 _
) As DirectSoundSecondaryBuffer8

Parts

object

Resolves to a DirectSound8 object.

original

DirectSoundSecondaryBuffer8 object to duplicate.

Return Values

Returns a DirectSoundSecondaryBuffer8 object.

Error Codes

If the method fails, an error is raised and Err.Number may be one of the following error values.

DSERR_ALLOCATED
DSERR_INVALIDCALL
DSERR_OUTOFMEMORY
DSERR_UNINITIALIZED

Remarks

This method is not valid for buffers created with the DSBCAPS_CTRLFX flag.

Initially, the duplicate buffer has 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.

Although duplicate buffers often share the same memory, this is not always the case. Changes in the data stored in one buffer are not necessarily reflected in its duplicates.

See Also