IAudioSystemEffectsCustomFormats::GetFormat method (audioenginebaseapo.h)

The GetFormat method retrieves an IAudioMediaType representation of a custom format.


HRESULT GetFormat(
  [in]            UINT            nFormat,
  [out, optional] IAudioMediaType **ppFormat


[in] nFormat

Specifies the index of a supported format. This parameter can be any value in the range from zero to one less than the return value of GetFormatCount. In other words, any value in the range from zero to GetFormatCount( ) - 1.

[out, optional] ppFormat

Specifies a pointer to a pointer to an IAudioMediaType interface. It is the responsibility of the caller to release the IAudioMediaType interface to which the ppFormat parameter points.

Return value

The GetFormat method returns S_OK when the call is successful. Otherwise, it returns one of the error codes shown in the following table.

Return code Description
Invalid pointer passed to function
Return buffer cannot be allocated
nFormat is out of range


When the audio system calls the GetFormat method, the sAPO creates an audio media type object and returns an IAudioMediaType interface. The sAPO implementation can use the CreateAudioMediaType utility function to create the audio media type object.


Minimum supported client Available in Windows Vista and later versions of Windows.
Target Platform Desktop
Header audioenginebaseapo.h (include Audioenginebaseapo.h)
IRQL All levels.

See also