procedure Lock( WriteCursor, WriteBytes: Longint; var Audio1Ptr: Pointer; var AudioBytes1: DWord; var Audio2Ptr: Pointer; var AudioBytes2: DWord; Flags: Longint );
Calls the interface Lock method to obtain a valid write pointer to the sound buffer's audio data. See IDirectSoundBuffer::Lock for more information.
You should handle the EDirectSoundError exception with error code DSERR_BUFFERLOST which may occur in normal circunstances.