FormatAudioGetCount Method (IMFFormat)
format's type
number of available formats
Gets number of available formats for selected type
Syntax
Sub FormatAudioGetCount( _
   ByVal _eFormatType As eMFormatType, _
   ByRef _pnCount As Integer _
) 
void FormatAudioGetCount( 
   eMFormatType _eFormatType,
   out int _pnCount
)
procedure FormatAudioGetCount( 
    _eFormatType: eMFormatType;
   Out  _pnCount: Integer
); 
void FormatAudioGetCount( 
   eMFormatType _eFormatType,
   [PARAMFLAG::Out] int _pnCount
) 

Parameters

_eFormatType
format's type
_pnCount
number of available formats
Example

Here is an example of how to fill a combobox with all available input audio formats for a live source and select a current format:

M_AUD_PROPS audProps;
int fCount;
m_objLive.FormatAudioGetCount(eMFormatType.eMFT_Input, out fCount);
if (fCount > 0)
{
    for (int i = 0; i < fCount; i++)
    {
        string name;
        m_objLive.FormatAudioGetByIndex(eMFormatType.eMFT_Input, i, out audProps, out name);
        comboBoxAF.Items.Add(name);
    }
    // Get current format
    int nCurrent = 0;
    try
    {
        string strName;
        M_AUD_PROPS _audProps;
        m_objLive.FormatAudioGet(eMFormatType.eMFT_Input, out _audProps, out nCurrent, out strName);
    }
    catch (System.Exception) { }
    // Select a current format
    comboBoxAF.SelectedIndex = nCurrent;
}
See Also

Reference

IMFFormat Interface
IMFFormat Members