This method of the DirectSound Class moves the unused portions of onboard sound memory, if any, to a contiguous block so that the largest portion of free memory will be available.
public void compact();
If the application calls this method, it must have exclusive cooperation with the DirectSound object. (To get exclusive access, specify DSSCL_EXCLUSIVE in a call to the setCooperativeLevel method.) This method will fail if any operations are in progress.