Skip to main content

Audio capture to MP3 file

Products: Video Capture SDK .Net

Sample code

1. Set sample MP3 settings, and apply them as output format

var mp3Output = new MP3Output();

mp3Output.CBR_Bitrate = 128;
mp3Output.VBR_MinBitrate = 128;
mp3Output.VBR_MaxBitrate = 192;
mp3Output.SampleRate = 44100;
mp3Output.ChannelsMode = MP3ChannelsMode.StandardStereo;
mp3Output.VBR_Mode = true;

VideoCapture1.Output_Format = mp3Output;

2. Set audio capture mode

VideoCapture1.Mode = VideoCaptureMode.AudioCapture;

3. Set file name

VideoCapture1.Output_Filename = "output.mp3";

4. Start capture (sync or async)

await VideoCapture1.StartAsync();

Required redists

How to install the required redists or deploy them to the user's PC?

Visit our GitHub page to get more code samples.