mindspore.dataset.audio.Flanger

class mindspore.dataset.audio.Flanger(sample_rate, delay=0.0, depth=2.0, regen=0.0, width=71.0, speed=0.5, phase=25.0, modulation=Modulation.SINUSOIDAL, interpolation=Interpolation.LINEAR)[source]

Apply a flanger effect to the audio.

Parameters
  • sample_rate (int) – Sampling rate of the waveform, e.g. 44100 (Hz).

  • delay (float, optional) – Desired delay in milliseconds (ms), range: [0, 30] (default=0.0).

  • depth (float, optional) – Desired delay depth in milliseconds (ms), range: [0, 10] (default=2.0).

  • regen (float, optional) – Desired regen (feedback gain) in dB, range: [-95, 95] (default=0.0).

  • width (float, optional) – Desired width (delay gain) in dB, range: [0, 100] (default=71.0).

  • speed (float, optional) – Modulation speed in Hz, range: [0.1, 10] (default=0.5).

  • phase (float, optional) – Percentage phase-shift for multi-channel, range: [0, 100] (default=25.0).

  • modulation (Modulation, optional) – Modulation of the input tensor (default=Modulation.SINUSOIDAL). It can be one of Modulation.SINUSOIDAL or Modulation.TRIANGULAR.

  • interpolation (Interpolation, optional) – Interpolation of the input tensor (default=Interpolation.LINEAR). It can be one of Interpolation.LINEAR or Interpolation.QUADRATIC.

Examples

>>> import numpy as np
>>>
>>> waveform = np.array([[2.716064453125e-03, 6.34765625e-03], [9.246826171875e-03, 1.0894775390625e-02]])
>>> numpy_slices_dataset = ds.NumpySlicesDataset(data=waveform, column_names=["audio"])
>>> transforms = [audio.Flanger(44100)]
>>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])