Microsoft Windows CE 3.0  

IDirectSound::DuplicateSoundBuffer

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The IDirectSound::DuplicateSoundBuffermethod creates a new DirectSoundBuffer object that uses the same buffer memory as the original object.

HRESULT DuplicateSoundBuffer(
LPDIRECTSOUNDBUFFER
lpDsbOriginal
,
LPLPDIRECTSOUNDBUFFER
lplpDsbDuplicate
);

Parameters

lpDsbOriginal
Address of the DirectSoundBuffer object to be duplicated.
lplpDsbDuplicate
Address of a pointer to the new DirectSoundBuffer object.

Return Values

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:

Remarks

The new object can be used just like the original.

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.

If data in the buffer is changed through one object, the change will be reflected in the other object because the buffer memory is shared.

The buffer memory will be released when the last object referencing it is released.

Applications cannot assume that an attempt to duplicate a sound buffer will always succeed. In particular, DirectSound will not create a software duplicate of a hardware buffer.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 2.12 or later. Version 2.12 requires DXPAK 1.0 or later. dsound.h   dsound.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

IDirectSound::CreateSoundBuffer