mindspore.dataset.audio.Gain
- class mindspore.dataset.audio.Gain(gain_db=1.0)[源代码]
Apply amplification or attenuation to the whole waveform.
- Parameters
gain_db (float) – Gain adjustment in decibels (dB) (default=1.0).
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.Gain(1.2)] >>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])