This method of the DirectSound Class creates a new DirectSoundBuffer object that uses the same buffer memory as the original object.
public DirectSoundBuffer duplicateSoundBuffer(DirectSoundBuffer original);
Returns the DirectSoundBuffer object if successful; null otherwise.
original | The DirectSoundBuffer object to be duplicated. |
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 since the buffer memory is shared.
The buffer memory will be released when the last object referencing it is released.