mindspore.dataset.audio.transforms.Contrast

class mindspore.dataset.audio.transforms.Contrast(enhancement_amount=75.0)[source]

Apply contrast effect. Similar to SoX implementation. Comparable with compression, this effect modifies an audio signal to make it sound louder.

Parameters

enhancement_amount (float) – Controls the amount of the enhancement. Allowed range is [0, 100] (default=75.0). Note that enhancement_amount equal to 0 still gives a significant contrast enhancement.

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.Contrast()]
>>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])