Articles in this section

External audio for live sources

By default, when you configure a live video source, it uses embedded audio source which is named <From Video>. And you can mix this embedded audio source with an external live audio, or disable the original audio and use only an external one. You can use any available DirectShow audio sources as external audio.

You can set external audio sources for MLive and MFLive objects as a specific device type.

MFormats SDK

To get a list of the available external audio source that you can use with a video device should call this code:

// get number of devices available for usage
int deviceCount;
myLiveSource.DeviceGetCount(eMFDeviceType.eMFDT_ExtAudio , out deviceCount);
// initialize an array to collect device names
string[] deviceArray;
if (deviceCount > 0)
{
deviceArray = new string[vCount];
for (int deviceIndex = 0; deviceIndex < deviceCount; deviceIndex++)
{
// get device by its index
string deviceName;
int isBusy; // indicates is it possible to use this device or is it busy in another application
myLiveSource.DeviceGetByIndex(eMFDeviceType.eMFDT_ExtAudio , deviceIndex, out deviceName, out isBusy);
deviceArray[deviceIndex] = deviceName;
}
}

Common features

Once the external audio source is specified, you get embedded audio mixed with external one as result. By default, external audio channels are added to original one as a new audio track. When you work with MLive/MFLive object only, all the tracks are merged together. So if your video source contains embedded audio with 2 channels and the external audio source also has 2 channels, as a result, you will get 4-channels audio.

To set where the external audio should be inserted you should set "ext_audio.insert_to_channels" property with the PropsSet method for you MFLive or MLive object. For example: