Microsoft DirectX 8.1 (Visual Basic)

DirectSound8.CreateSoundBuffer

The CreateSoundBuffer method creates a secondary buffer to mix audio samples into the primary buffer.

Syntax

object.CreateSoundBuffer( _
  bufferDesc As DSBUFFERDESC _
) As DirectSoundSecondaryBuffer8

Parts

object

Resolves to a DirectSound8 object.

bufferDesc

DSBUFFERDESC type that specifies the description of the sound buffer to create.

Return Values

Returns a DirectSoundSecondaryBuffer8 object.

Error Codes

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

DSERR_ALLOCATED
DSERR_BADFORMAT
DSERR_BUFFERTOOSMALL
DSERR_CONTROLUNAVAIL
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_OUTOFMEMORY
DSERR_UNINITIALIZED
DSERR_UNSUPPORTED

Remarks

DirectSound does not initialize the contents of the buffer, and the application cannot assume that it contains silence.

If an attempt is made to create a buffer with the DSBCAPS_LOCHARDWARE flag on a system where hardware acceleration is not available, the method fails with either DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL, depending on the operating system.

See Also