Skip to content

Commit 3e5c353

Browse files
authored
Fixes #1314: Add missing functionals and transform to docs.(#1317)
1 parent a751e1d commit 3e5c353

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

docs/source/functional.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,13 @@ vad
208208
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209209

210210
.. autofunction:: compute_kaldi_pitch
211+
212+
:hidden:`spectral_centroid`
213+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
214+
215+
.. autofunction:: spectral_centroid
216+
217+
:hidden:`apply_codec`
218+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
219+
220+
.. autofunction:: apply_codec

docs/source/transforms.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ Transforms are common audio transforms. They can be chained together using :clas
136136

137137
.. automethod:: forward
138138

139+
:hidden:`SpectralCentroid`
140+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
141+
142+
.. autoclass:: SpectralCentroid
143+
144+
.. automethod:: forward
145+
139146
:hidden:`Vad`
140147
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
141148

torchaudio/functional/functional.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,24 +1011,25 @@ def apply_codec(
10111011
bits_per_sample: Optional[int] = None,
10121012
) -> Tensor:
10131013
r"""
1014-
Applies codecs as a form of augmentation
1014+
Apply codecs as a form of augmentation.
1015+
10151016
Args:
1016-
waveform (Tensor): Audio data. Must be 2 dimensional. See also ```channels_first```
1017-
sample_rate (int): Sample rate of the audio waveform
1018-
format (str): file format
1017+
waveform (Tensor): Audio data. Must be 2 dimensional. See also ```channels_first```.
1018+
sample_rate (int): Sample rate of the audio waveform.
1019+
format (str): File format.
10191020
channels_first (bool):
10201021
When True, both the input and output Tensor have dimension ``[channel, time]``.
10211022
Otherwise, they have dimension ``[time, channel]``.
10221023
compression (float): Used for formats other than WAV.
1023-
For mor details see :py:func:`torchaudio.backend.sox_io_backend.save`
1024+
For mor details see :py:func:`torchaudio.backend.sox_io_backend.save`.
10241025
encoding (str, optional): Changes the encoding for the supported formats.
1025-
For more details see :py:func:`torchaudio.backend.sox_io_backend.save`
1026+
For more details see :py:func:`torchaudio.backend.sox_io_backend.save`.
10261027
bits_per_sample (int, optional): Changes the bit depth for the supported formats.
1027-
For more details see :py:func:`torchaudio.backend.sox_io_backend.save`
1028+
For more details see :py:func:`torchaudio.backend.sox_io_backend.save`.
10281029
10291030
Returns:
10301031
torch.Tensor: Resulting Tensor.
1031-
If ``channels_first=True``, it has ``[channel, time]`` else ``[time, channel]``
1032+
If ``channels_first=True``, it has ``[channel, time]`` else ``[time, channel]``.
10321033
"""
10331034
bytes = io.BytesIO()
10341035
torchaudio.backend.sox_io_backend.save(bytes,

0 commit comments

Comments
 (0)