play method

void play(
  1. String name, {
  2. double? fade,
  3. bool restart = false,
})

Plays name from its start, fading from what played over fade seconds (crossfade when null; 0 cuts). Asking for the clip already playing does nothing unless restart. The authored clip stays as it is.

What fades out goes on as it played — at its playingSpeed, looping or holding at its end as playingLoop said — so set those for the new clip after this call, not before.

Implementation

void play(String name, {double? fade, bool restart = false}) {
  if (name == playingClip && !isBlending && !restart) {
    _playingNow = true;
    return;
  }
  _fadeFromNow(fade ?? crossfade);
  _clipNow = name;
  blendClips = const [];
  blendWeights = const [];
  blendSpeeds = const [];
  time = 0;
  previousTime = 0;
  cycles = 0;
  _playingNow = true;
}