Microsoft DirectX 8.1 (C++)

IDirectSoundCaptureBuffer8::GetFormat

The GetFormat method retrieves the format of the capture buffer.

Syntax

HRESULT GetFormat(
  LPWAVEFORMATEX pwfxFormat, 
  DWORD dwSizeAllocated, 
  LPDWORD pdwSizeWritten 
);

Parameters

pwfxFormat

Address of a WAVEFORMATEX structure that receives a description of the sound data in the capture buffer. To retrieve the buffer size needed to contain the format description, specify NULL.; in this case, the DWORD pointed to by the pdwSizeWritten parameter receives the size of the structure needed to receive complete format information.

dwSizeAllocated

Size, in bytes, of the WAVEFORMATEX structure. DirectSoundCapture writes, at most, dwSizeAllocated bytes to the structure; if the structure requires more memory, it is truncated.

pdwSizeWritten

Address of a variable that receives the number of bytes written to the WAVEFORMATEX structure; or, if pwfxFormat is NULL, the size of the WAVEFORMATEX structure that would be necessary to receive the information. This parameter can be NULL if the value is not wanted.

Return Values

If the method succeeds, the return value is DS_OK.

If the method fails, the return value may be DSERR_INVALIDPARAM.

Requirements

  Header: Declared in dsound.h.

See Also