Platform SDK: DirectX

DirectSound.CreateSoundBuffer

The DirectSound.CreateSoundBuffer method creates a DirectSoundBuffer object to hold a sequence of audio samples.

object.CreateSoundBuffer(bufferDesc As DSBUFFERDESC, _
    format As WAVEFORMATEX) As DirectSoundBuffer

Parameters

object
Object expression that resolves to a DirectSound object.
bufferDesc
DSBUFFERDESC type that specifies the description of the sound buffer to create.
format
WAVEFORMATEX type that specifies the format of the data to be played by the buffer.

Return Values

If the method succeeds, a DirectSoundBuffer object is returned.

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_OUTOFMEMORY
DSERR_UNINITIALIZED
DSERR_UNSUPPORTED

See Also

DirectSound.CreateSoundBufferFromFile, DirectSound.CreateSoundBufferFromResource, DirectSound.DuplicateSoundBuffer