genWaveform method

WaveformSound genWaveform(
  1. WaveformType type, {
  2. double freq = 440.0,
  3. @Deprecated("Should be used only in special cases (see the migration guide in README).") bool doAddToFinalizer = true,
})

Generates a waveform sound using given parameters.

Implementation

WaveformSound genWaveform(
  WaveformType type, {
  double freq = 440.0,
  @Deprecated(
      "Should be used only in special cases (see the migration guide in README).")
  bool doAddToFinalizer = true,
}) {
  final platformSound = _engine.generateWaveform(type: type, freq: freq);
  final sound = WaveformSound._(platformSound);
  if (doAddToFinalizer) _soundsFinalizer.attach(sound, platformSound);
  return sound;
}