mindspore.dataset.audio.Overdrive

class mindspore.dataset.audio.Overdrive(gain=20.0, color=20.0)[源代码]

Apply overdrive on input audio.

Parameters
  • gain (float, optional) – Desired gain at the boost (or attenuation) in dB, in range of [0, 100] (default=20.0).

  • color (float, optional) – Controls the amount of even harmonic content in the over-driven output, in range of [0, 100] (default=20.0).

Examples

>>> import numpy as np
>>>
>>> waveform = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.float32)
>>> numpy_slices_dataset = ds.NumpySlicesDataset(data=waveform, column_names=["audio"])
>>> transforms = [audio.Overdrive()]
>>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])