Skip to main content

How to make an audio volume envelope effect?

Product: Video Edit SDK .Net. Engine: VideoEditCore (Windows only).

Sample code

1. Create an audio source for a specified file

var audioFile = new AudioSource(file, segments, null);

2. Create audio volume envelope effect, 70% value used. Can be 0 - 100%

streams.Add(new FFMPEGStream
{
Filename = "c:\\samples\\!video.avi",
ID = "v"
});

Add audio stream from mp3 file. The ID is set to "a" to add the audio stream. Must be "a" for audio files.

var envelope = new AudioVolumeEnvelopeEffect(70);

Add audio stream from another AVI file. The ID is set to "a" to add an audio stream from a video file.

streams.Add(new FFMPEGStream
{
Filename = "c:\\samples\\!video2.avi",
ID = "a"
});

3. Add audio source with effect applied to the timeline

VideoEdit1.Input_AddAudioFile(audioFile, TimeSpan.FromMilliseconds(0), 0, new []{ envelope });

Required redists

  • Video Edit SDK redist x86 x64

How can the required redists be installed or deployed to the user's PC?


Visit our GitHub page to get more code samples.