fade method

  1. @override
void fade({
  1. required double length,
  2. double endGain = 0.0,
  3. double? startGain,
  4. double preFade = 0.0,
})
override

Fade generator.

Implementation

@override
void fade({
  required final double length,
  final double endGain = 0.0,
  final double? startGain,
  final double preFade = 0.0,
}) {
  checkDeadSound();
  final startTime = context.currentTime.value;
  final endTime = startTime + length;
  generator.gain.automate(
    startTime: startTime,
    startValue: startGain ?? generator.gain.value,
    endTime: endTime,
    endValue: endGain,
  );
}