Shortcuts

Loudness

class torchaudio.transforms.Loudness(sample_rate: int)[source]

Measure audio loudness according to the ITU-R BS.1770-4 recommendation.

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

sample_rate (int) – Sample rate of audio signal.

Example
>>> waveform, sample_rate = torchaudio.load("test.wav", normalize=True)
>>> transform = transforms.Loudness(sample_rate)
>>> loudness = transform(waveform)
Reference:
forward(wavefrom: Tensor)[source]
Parameters:

waveform (torch.Tensor) – audio waveform of dimension (…, channels, time)

Returns:

loudness estimates (LKFS)

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