MFORMATSLib Namespace > IMFFormat Interface : FormatAudioGetByIndex Method |
Sub FormatAudioGetByIndex( _ ByVal _eFormatType As eMFormatType, _ ByVal _nIndex As Integer, _ ByRef _pAudProps As M_AUD_PROPS, _ ByRef _pbsName As String _ )
void FormatAudioGetByIndex( eMFormatType _eFormatType, int _nIndex, out M_AUD_PROPS _pAudProps, out string _pbsName )
procedure FormatAudioGetByIndex( _eFormatType: eMFormatType; _nIndex: Integer; Out _pAudProps: M_AUD_PROPS; Out _pbsName: String );
void FormatAudioGetByIndex( eMFormatType _eFormatType, int _nIndex, [PARAMFLAG::Out] M_AUD_PROPS _pAudProps, [PARAMFLAG::Out] BSTR* _pbsName )
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; }