genNoise method

NoiseSound genNoise(
  1. NoiseType type, {
  2. int seed = 0,
  3. @Deprecated("Should be used only in special cases (see the migration guide in README).") bool doAddToFinalizer = true,
})

Generates a noise sound using given parameters.

Implementation

NoiseSound genNoise(
  NoiseType type, {
  int seed = 0,
  @Deprecated(
      "Should be used only in special cases (see the migration guide in README).")
  bool doAddToFinalizer = true,
}) {
  final platformSound = _engine.generateNoise(type: type, seed: seed);
  final sound = NoiseSound._(platformSound);
  if (doAddToFinalizer) _soundsFinalizer.attach(sound, platformSound);
  return sound;
}