Microsoft DirectX 8.1 (Visual Basic)

DirectSoundPrimaryBuffer8.Restore

The Restore method restores the memory allocation for a lost buffer.

Syntax

object.Restore()

Parts

object

Resolves to a DirectSoundPrimaryBuffer8 object.

Error Codes

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

DSERR_BUFFERLOST
DSERR_INVALIDCALL
DSERR_PRIOLEVELNEEDED

Remarks

After DirectSound restores the buffer memory, the application must rewrite the buffer with valid sound data. DirectSound cannot restore the contents of the memory, only the memory itself.

The application can receive notification that a buffer is lost when it specifies that buffer in a call to the DirectSoundSecondaryBuffer8.Play method. This method raises the DSERR_BUFFERLOST error to indicate a lost buffer. The DirectSoundSecondaryBuffer8.GetStatus method can also be used to retrieve the status of the sound buffer and test for the DSBSTATUS_BUFFERLOST flag.

See Also