playSound function

PlaySound playSound({
  1. required SoundChannel channel,
  2. required Sound sound,
  3. required AssetList assets,
  4. bool keepAlive = false,
  5. bool looping = false,
})

Play the given sound through the given channel.

Implementation

PlaySound playSound({
  required final SoundChannel channel,
  required final Sound sound,
  required final AssetList assets,
  final bool keepAlive = false,
  final bool looping = false,
}) =>
    channel.playSound(
      getAssetReferenceReference(assets: assets, id: sound.id).reference,
      gain: sound.gain,
      keepAlive: keepAlive,
      looping: looping,
    );