Skip to content

AudioCompressors

property, read-only

Delphi
property AudioCompressors: string read GetAudioCompressors;
C++Builder
__property System::UnicodeString AudioCompressors = {read=GetAudioCompressors};
C#
public string AudioCompressors { get; }
VB.NET
Public ReadOnly Property AudioCompressors As String
C++/Qt
wchar_t *GetAudioCompressors ();

Returns a string that contains the list of the audio compressors (audio codecs) available on the current platform.

This list can be assigned to list-based controls, e.g.:

ComboBox1.Items.Text := VideoGrabber1.AudioCompressors;
ComboBox1.ItemIndex := VideoGrabber1.AudioCompressor;

The index of an audio compressor can be retrieved programmatically with the FindIndexInListByName function as follows:

VideoGrabber.AudioCompressor := VideoGrabber.FindIndexInListByName (VideoGrabber.AudioCompressors, 'name of my audio encoder', false, true);

The Media Foundation audio encoders of the platform, e.g. "AAC (Microsoft)", "MP3 (Microsoft)", "WMA (Microsoft)", are listed after the Datastead Multipurpose Encoder (index 0) and before the DirectShow compressors. They are used through the Datastead MFT Encoder of TVideoGrabber, without registration.

An encoder or a DirectShow compressor that appears after the first build of the list (e.g. RefreshDevicesAndCompressorsLists after the installation of a driver or a codec) is appended at the end of the list. Select the compressors by name (FindIndexInListByName) rather than by a fixed index.

The bit rate of a Media Foundation audio encoder entry can be set with ShowDialog (dlg_AudioCompressor); the encoder uses the supported bit rate nearest to it. This bit rate is saved for that entry, like the settings of the DirectShow compressors (registry; SaveCompressorSettingsToDataString / LoadCompressorSettingsFromDataString), and used from the next recording; the bit rate set with AudioCompression_SetInt (ac_BitRate) takes precedence. The Encoder_SetInt / Encoder_SetStr settings do not apply to these entries (FFmpeg codecs of the Datastead Multipurpose Encoder only).

The "Datastead Multipurpose Encoder" entry (index 0) is always listed; when the Datastead Multipurpose Encoder is installed, it uses the FFmpeg audio codecs, configured with Encoder_SetInt / Encoder_SetStr (see using the Datastead Encoder).

Note: when the application starts, the VideoCompressors and AudioCompressors lists are populated with the codecs currently installed. To refresh the compressor lists after installing or uninstalling codecs without exiting and restarting the application, invoke RefreshDevicesAndCompressorsLists.