DirectX SDK

DirectSound.CreateSoundBufferFromResource

The DirectSound.CreateSoundBufferFromResource method creates a DirectSoundBuffer object to hold a sequence of audio samples. The sound resource must be of type .wav.

object.CreateSoundBufferFromResource( _
    dll As String, _
    resourceName As String, _
    bufferDesc As DSBUFFERDESC, _
    format As WAVEFORMATEX) As DirectSoundBuffer

Parameters

object
Object expression that resolves to a DirectSound object.
dll
The name of the DLL that contains the resource.
resourceName
The name of the resource that is loaded in the sound buffer to be created.
bufferDesc
A DSBUFFERDESC type that contains the description of the sound buffer to be created.
format
A WAVEFORMATEX type that describes the format of waveform-audio data.

Return Values

If the method succeeds, a DirectSoundBuffer 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_INVALIDPARAM
DSERR_NOAGGREGATION
DSERR_OUTOFMEMORY
DSERR_UNINITIALIZED
DSERR_UNSUPPORTED