mindspore.dataset.audio.Overdrive

class mindspore.dataset.audio.Overdrive(gain=20.0, color=20.0)[source]

Apply an overdrive effect to the audio waveform.

Similar to SoX implementation.

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.

Raises
  • TypeError – If gain is not of type float.

  • ValueError – If gain is not in range of [0, 100].

  • TypeError – If color is not of type float.

  • ValueError – If color is not in range of [0, 100].

  • RuntimeError – If input tensor is not in shape of <…, time>.

Supported Platforms:

CPU

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"])