The DirectSoundBuffer.GetFormat method retrieves a description of the wave format of the buffer.
object.GetFormat(format As WAVEFORMATEX)
If the method fails, an error is raised and Err.Number may be set to DSERR_INVALIDPARAM.
DirectSoundBuffer.SetFormat