Table of Contents

Class AudioVolumeEnvelopeEffect

Namespace
VisioForge.Core.Types.VideoEdit
Assembly
VisioForge.Core.dll

Represents an audio volume envelope effect that applies a constant volume level to a portion of an audio track.

public class AudioVolumeEnvelopeEffect : AudioTrackEffect

Inheritance

Inherited Members

Examples

// Example 1: Reduce volume during narration
var duckingEffect = new AudioVolumeEnvelopeEffect(30) // 30% volume
{
    StartTime = TimeSpan.FromSeconds(10),
    StopTime = TimeSpan.FromSeconds(25)
};

// Example 2: Create multiple volume levels
var effects = new[]
{
    new AudioVolumeEnvelopeEffect(100) { StartTime = TimeSpan.Zero, StopTime = TimeSpan.FromSeconds(5) },
    new AudioVolumeEnvelopeEffect(50) { StartTime = TimeSpan.FromSeconds(5), StopTime = TimeSpan.FromSeconds(10) },
    new AudioVolumeEnvelopeEffect(75) { StartTime = TimeSpan.FromSeconds(10), StopTime = TimeSpan.FromSeconds(15) }
};

// Example 3: Mute a section
var muteEffect = new AudioVolumeEnvelopeEffect(0) // Silence
{
    StartTime = TimeSpan.FromSeconds(30),
    StopTime = TimeSpan.FromSeconds(35)
};

Remarks

The VisioForge.Core.Types.VideoEdit.AudioVolumeEnvelopeEffect class allows you to set a specific volume level for a defined time period within an audio track. This is useful for creating ducking effects, emphasizing or de-emphasizing certain portions of audio, or creating dynamic volume changes.

Key features:

  • Set a constant volume level for a specific time range
  • Volume is specified as a percentage (0-100)
  • Can be applied to entire track or specific segments
  • Multiple envelope effects can be applied to create complex volume curves

Unlike VisioForge.Core.Types.VideoEdit.AudioVolumeFadeEffect which creates gradual transitions, this effect applies an immediate volume change at the start time and maintains it until the stop time.

Constructors

AudioVolumeEnvelopeEffect(int)

Initializes a new instance of the VisioForge.Core.Types.VideoEdit.AudioVolumeEnvelopeEffect class with a specified volume level.

public AudioVolumeEnvelopeEffect(int level)

Parameters

level int

The volume level as a percentage (0-100). 0 represents silence, 100 represents original volume. Values outside this range may be clamped or cause audio distortion.

Examples

// Create effect for entire track
var fullTrackEffect = new AudioVolumeEnvelopeEffect(75);

// Create effect for specific time range
var timedEffect = new AudioVolumeEnvelopeEffect(50)
{
    StartTime = TimeSpan.FromSeconds(10),
    StopTime = TimeSpan.FromSeconds(20)
};

// Create ducking effect for background music
var duckingEffect = new AudioVolumeEnvelopeEffect(30)
{
    StartTime = TimeSpan.FromSeconds(5),
    StopTime = TimeSpan.FromSeconds(15)
};

Remarks

By default, the effect is configured to apply to the entire audio track (StartTime and StopTime are null). To apply the effect to a specific time range, set the VisioForge.Core.Types.VideoEdit.AudioTrackEffect.StartTime and VisioForge.Core.Types.VideoEdit.AudioTrackEffect.StopTime properties after construction.

Properties

Level

Gets or sets the volume level to apply during the effect period.

public int Level { get; set; }

Property Value

int

Examples

// Different volume scenarios
var backgroundMusic = new AudioVolumeEnvelopeEffect(25);  // Quiet background
var normalVolume = new AudioVolumeEnvelopeEffect(100);   // Original volume
var emphasize = new AudioVolumeEnvelopeEffect(110);      // Slightly boosted (use carefully)

Remarks

The volume level is applied as a multiplier to the original audio amplitude. For example, a level of 50 will reduce the audio to half its original volume.

Common use cases:

  • 0-20: Background/ambient level
  • 30-50: Reduced volume for ducking under narration
  • 70-90: Slightly reduced for mixing
  • 100: Original level