genPulse method

  1. @Deprecated("This is a part of a non-consistent API, so probably will be removed in the future. Use `generateWaveform` with `WaveformType.square` instead. In case you are really relying on the variable duty cycle, create a GitHub issue explaining your usecase and I will bring this capability into regular waveforms.")
PulseSound genPulse({
  1. double freq = 440.0,
  2. double dutyCycle = 0.5,
})

Generates a pulsewave sound with provided freq and dutyCycle.

Implementation

@Deprecated(
    "This is a part of a non-consistent API, so probably will be removed in the future. Use `generateWaveform` with `WaveformType.square` instead. In case you are really relying on the variable duty cycle, create a GitHub issue explaining your usecase and I will bring this capability into regular waveforms.")
PulseSound genPulse({double freq = 440.0, double dutyCycle = 0.5}) {
  final platformSound = _engine.generatePulse();
  final sound = PulseSound._(platformSound);
  _soundsFinalizer.attach(sound, platformSound);
  return sound
    ..freq = freq
    ..dutyCycle = dutyCycle;
}