Platform SDK: DirectX |
The IDirectSoundBuffer::GetFormat method retrieves a description of the format of the sound data in the buffer, or the buffer size needed to retrieve the format description.
HRESULT GetFormat( LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten );
If the method succeeds, the return value is DS_OK.
If the method fails, the return value may be DSERR_INVALIDPARAM.
The WAVEFORMATEX structure can have a variable length that depends on the details of the format. Before retrieving the format description, the application should query the DirectSoundBuffer object for the size of the format by calling this method and specifying NULL for the lpwfxFormat parameter. The size of the structure will be returned in the lpdwSizeWritten parameter. The application can then allocate sufficient memory and call IDirectSoundBuffer::GetFormat again to retrieve the format description.
Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dsound.h.
Import Library: Use dsound.lib.