handleCustomSound method

void handleCustomSound(
  1. CustomSound customSound
)

Handle the given customSound.

Implementation

void handleCustomSound(final CustomSound customSound) {
  final assetReference = getCustomSound(customSound);
  final audioBusId = customSound.audioBusId;
  final SoundChannel channel;
  if (audioBusId == null) {
    channel = game.interfaceSounds;
  } else {
    channel = getAudioBus(world.getAudioBus(audioBusId));
  }
  channel.playSound(
    assetReference,
    gain: customSound.gain,
  );
}