- class torchaudio.transforms.MuLawEncoding(quantization_channels: int = 256)¶
Encode signal based on mu-law companding.
For more info see the Wikipedia Entry
This algorithm assumes the signal has been scaled to between -1 and 1 and returns a signal encoded with values from 0 to quantization_channels - 1
quantization_channels (int, optional) – Number of channels. (Default:
>>> waveform, sample_rate = torchaudio.load("test.wav", normalize=True) >>> transform = torchaudio.transforms.MuLawEncoding(quantization_channels=512) >>> mulawtrans = transform(waveform)