playBlend method

void playBlend(
  1. List<String> clips,
  2. List<double> weights, {
  3. List<double>? speeds,
  4. double? fade,
})

Plays clips together, weighted by weights (see setBlendWeights) and kept in step, fading from what played over fade seconds.

speeds are each clip's own rate (1 when null). One cycle lasts the clips' lengths over their speeds, weighted; a clip listed twice, at two speeds, plays at their speeds' weighted mean.

Implementation

void playBlend(
  List<String> clips,
  List<double> weights, {
  List<double>? speeds,
  double? fade,
}) {
  assert(clips.length == weights.length, 'one weight per clip');
  _fadeFromNow(fade ?? crossfade);
  _clipNow = clips.isEmpty ? '' : clips.first;
  blendClips = List.of(clips);
  blendWeights = List.of(weights);
  blendSpeeds = speeds == null
      ? List.filled(clips.length, 1.0)
      : List.of(speeds);
  phase = 0;
  previousPhase = 0;
  time = 0;
  previousTime = 0;
  cycles = 0;
  _playingNow = true;
}