Shortcuts

MuLawDecoding

class torchaudio.transforms.MuLawDecoding(quantization_channels: int = 256)[source]

Decode mu-law encoded signal.

This feature supports the following devices: CPU, CUDA This API supports the following properties: TorchScript

For more info see the Wikipedia Entry

This expects an input with values between 0 and quantization_channels - 1 and returns a signal scaled between -1 and 1.

Parameters:

quantization_channels (int, optional) – Number of channels. (Default: 256)

Example
>>> waveform, sample_rate = torchaudio.load("test.wav", normalize=True)
>>> transform = torchaudio.transforms.MuLawDecoding(quantization_channels=512)
>>> mulawtrans = transform(waveform)
forward(x_mu: Tensor) Tensor[source]
Parameters:

x_mu (Tensor) – A mu-law encoded signal which needs to be decoded.

Returns:

The signal decoded.

Return type:

Tensor

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources