IAudioSystemEffectsCustomFormats::GetFormat method (audioenginebaseapo.h)

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

Syntax

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

Parameters

[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
E_POINTER
Invalid pointer passed to function
E_OUTOFMEMORY
Return buffer cannot be allocated
E_INVALIDARG
nFormat is out of range

Remarks

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.

Requirements

Requirement Value
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

CreateAudioMediaType

GetFormatCount

IAudioMediaType