Skip to content

Commit 0c94d6e

Browse files
ravicodelabsfacebook-github-bot
authored andcommitted
Added example for Loudness transform (#2641)
Summary: Added example for Loudness transform (implemented in PR #2472) as mentioned in issue #1564. Pull Request resolved: #2641 Reviewed By: nateanl Differential Revision: D38907782 Pulled By: carolineechen fbshipit-source-id: fd2bcc4bac3095a626ea9cf36cb70cb2bf003d63
1 parent 533f874 commit 0c94d6e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

torchaudio/transforms/_transforms.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,11 @@ class Loudness(torch.nn.Module):
12931293
Args:
12941294
sample_rate (int): Sample rate of audio signal.
12951295
1296+
Example
1297+
>>> waveform, sample_rate = torchaudio.load("test.wav", normalize=True)
1298+
>>> transform = transforms.Loudness(sample_rate)
1299+
>>> loudness = transform(waveform)
1300+
12961301
Reference:
12971302
- https://www.itu.int/rec/R-REC-BS.1770-4-201510-I/en
12981303
"""

0 commit comments

Comments
 (0)