mindspore.dataset.audio.MuLawDecoding

class mindspore.dataset.audio.MuLawDecoding(quantization_channels=256)[source]

Decode mu-law encoded signal, refer to mu-law algorithm .

Parameters

quantization_channels (int, optional) – Number of channels, which must be positive. Default: 256.

Raises
  • TypeError – If quantization_channels is not of type int.

  • ValueError – If quantization_channels is not a positive number.

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

Supported Platforms:

CPU

Examples

>>> import numpy as np
>>>
>>> waveform = np.random.random([1, 3, 4])
>>> numpy_slices_dataset = ds.NumpySlicesDataset(data=waveform, column_names=["audio"])
>>> transforms = [audio.MuLawDecoding()]
>>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])