Audio sources
Products: Video Capture SDK .Net
You can get audio from the following sources:
- Audio capture devices
- Audio from speakers
- IP cameras source
- NDI source
- RTSP source
Audio capture devices
Enumerate audio capture devices.
foreach (var device in VideoCapture1.Audio_CaptureDevices())
{
// add to some combobox
cbAudioInputDevice.Items.Add(device.Name);
}
Enumerate audio formats.
// find the device by name
var deviceItem = VideoCapture1.Audio_CaptureDevices().FirstOrDefault(device => device.Name == "Some device name");
// enumerate formats
foreach (var format in deviceItem.Formats)
{
cbAudioInputFormat.Items.Add(format);
}
Set audio capture device as a source.
// find the device by name
var deviceItem = VideoCapture1.Audio_CaptureDevices().FirstOrDefault(device => device.Name == "Some device name");
VideoCapture1.Audio_CaptureDevice = new AudioCaptureSource(deviceItem.Name);
VideoCapture1.Audio_CaptureDevice.Format = deviceItem.Formats[0].ToString();
Audio from speakers
Set the audio capture source to VisioForge What You Hear Source
to use audio loopback and capture sound from speakers.
VideoCapture1.Audio_CaptureDevice = new AudioCaptureSource("VisioForge What You Hear Source");
VideoCapture1.Audio_CaptureDevice.Format_UseBest = true;
IP camera source
Use the AudioCapture
property of IPCameraSourceSettings
to enable audio capture.
Visit our GitHub page to get more code samples.