index.rst 17 KB
Newer Older
moto's avatar
moto committed
1
2
3
Torchaudio Documentation
========================

moto's avatar
moto committed
4
5
.. image:: _static/img/logo.png

moto's avatar
moto committed
6
7
8
Torchaudio is a library for audio and signal processing with PyTorch.
It provides I/O, signal and data processing functions, datasets,
model implementations and application components.
Brian Johnson's avatar
Brian Johnson committed
9

moto's avatar
moto committed
10
11
12
..
   Generate Table Of Contents (left navigation bar)
   NOTE: If you are adding tutorials, add entries to toctree and customcarditem below
13

moto's avatar
moto committed
14
15
16
.. toctree::
   :maxdepth: 1
   :caption: Torchaudio Documentation
moto's avatar
moto committed
17
   :hidden:
18

moto's avatar
moto committed
19
   Index <self>
moto's avatar
moto committed
20
   supported_features
moto's avatar
moto committed
21
   feature_classifications
moto's avatar
moto committed
22
   logo
23
   references
24

25
26
27
28
29
30
31
32
33
34
.. toctree::
   :maxdepth: 2
   :caption: Installation
   :hidden:

   installation
   build
   build.linux
   build.windows
   build.jetson
35
   build.ffmpeg
36

moto's avatar
moto committed
37
38
39
40
41
42
43
44
45
46
.. toctree::
   :maxdepth: 1
   :caption: API Tutorials
   :hidden:

   tutorials/audio_io_tutorial
   tutorials/streamreader_basic_tutorial
   tutorials/streamreader_advanced_tutorial
   tutorials/streamwriter_basic_tutorial
   tutorials/streamwriter_advanced
47
   tutorials/nvdec_tutorial
moto's avatar
moto committed
48
   tutorials/nvenc_tutorial
moto's avatar
moto committed
49

moto's avatar
moto committed
50
   tutorials/effector_tutorial
moto's avatar
moto committed
51
52
53
54
   tutorials/audio_resampling_tutorial
   tutorials/audio_data_augmentation_tutorial
   tutorials/audio_feature_extractions_tutorial
   tutorials/audio_feature_augmentation_tutorial
55
   tutorials/ctc_forced_alignment_api_tutorial
moto's avatar
moto committed
56

moto's avatar
moto committed
57
   tutorials/oscillator_tutorial
moto's avatar
moto committed
58
   tutorials/additive_synthesis_tutorial
moto's avatar
moto committed
59
   tutorials/filter_design_tutorial
60
   tutorials/subtractive_synthesis_tutorial
moto's avatar
moto committed
61
62
63
64
65
66
67
68
69
70

   tutorials/audio_datasets_tutorial

.. toctree::
   :maxdepth: 1
   :caption: Pipeline Tutorials
   :hidden:

   tutorials/speech_recognition_pipeline_tutorial
   tutorials/asr_inference_with_ctc_decoder_tutorial
71
   tutorials/asr_inference_with_cuda_ctc_decoder_tutorial
moto's avatar
moto committed
72
73
   tutorials/online_asr_tutorial
   tutorials/device_asr
74
   tutorials/device_avsr
moto's avatar
moto committed
75
   tutorials/forced_alignment_tutorial
76
   tutorials/forced_alignment_for_multilingual_data_tutorial
moto's avatar
moto committed
77
78
79
   tutorials/tacotron2_pipeline_tutorial
   tutorials/mvdr_tutorial
   tutorials/hybrid_demucs_tutorial
80
   tutorials/squim_tutorial
81

moto's avatar
moto committed
82
83
84
85
86
87
88
89
90
.. toctree::
   :maxdepth: 1
   :caption: Training Recipes
   :hidden:

   Conformer RNN-T ASR <https://github.com/pytorch/audio/tree/main/examples/asr/librispeech_conformer_rnnt>
   Emformer RNN-T ASR <https://github.com/pytorch/audio/tree/main/examples/asr/emformer_rnnt>
   Conv-TasNet Source Separation <https://github.com/pytorch/audio/tree/main/examples/source_separation>
   HuBERT Pre-training and Fine-tuning (ASR) <https://github.com/pytorch/audio/tree/main/examples/hubert>
91
   Real-time AV-ASR <https://github.com/pytorch/audio/tree/main/examples/avsr>
moto's avatar
moto committed
92

93
.. toctree::
94
   :maxdepth: 1
moto's avatar
moto committed
95
   :caption: Python API Reference
moto's avatar
moto committed
96
   :hidden:
97

98
   torchaudio
99
   io
100
101
   functional
   transforms
102
   datasets
103
   models
104
   models.decoder
105
   pipelines
106
   sox_effects
jamarshon's avatar
jamarshon committed
107
   compliance.kaldi
108
   kaldi_io
moto's avatar
moto committed
109
   utils
moto's avatar
moto committed
110

moto's avatar
moto committed
111
112
113
114
115
116
117
118
.. toctree::
   :maxdepth: 1
   :hidden:

   torio
   torio.io
   torio.utils

moto's avatar
moto committed
119
120
.. toctree::
   :maxdepth: 1
moto's avatar
moto committed
121
   :caption: Python Prototype API Reference
moto's avatar
moto committed
122
   :hidden:
moto's avatar
moto committed
123

hwangjeff's avatar
hwangjeff committed
124
   prototype
hwangjeff's avatar
hwangjeff committed
125
   prototype.datasets
hwangjeff's avatar
hwangjeff committed
126
   prototype.functional
127
   prototype.models
128
   prototype.pipelines
hwangjeff's avatar
hwangjeff committed
129
   prototype.transforms
130

moto's avatar
moto committed
131
132
133
134
135
.. toctree::
   :maxdepth: 1
   :caption: C++ Prototype API Reference
   :hidden:

moto's avatar
moto committed
136
137
138
   libtorio
   libtorio.stream_reader
   libtorio.stream_writer
moto's avatar
moto committed
139

moto's avatar
moto committed
140
.. toctree::
141
   :maxdepth: 1
moto's avatar
moto committed
142
143
   :caption: PyTorch Libraries
   :hidden:
moto's avatar
moto committed
144

moto's avatar
moto committed
145
146
147
148
149
150
151
   PyTorch <https://pytorch.org/docs>
   torchaudio <https://pytorch.org/audio>
   torchtext <https://pytorch.org/text>
   torchvision <https://pytorch.org/vision>
   TorchElastic <https://pytorch.org/elastic/>
   TorchServe <https://pytorch.org/serve>
   PyTorch on XLA Devices <http://pytorch.org/xla/>
152

moto's avatar
moto committed
153
154
Tutorials
---------
155

moto's avatar
moto committed
156
157
.. customcardstart::

158
159
160
161
162
163
164
.. customcarditem::
   :header: AM inference with CUDA CTC Beam Seach Decoder
   :card_description: Learn how to perform ASR beam search decoding with GPU, using <code>torchaudio.models.decoder.cuda_ctc_decoder</code>.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/asr_inference_with_ctc_decoder_tutorial.png
   :link: tutorials/asr_inference_with_cuda_ctc_decoder_tutorial.html
   :tags: Pipelines,ASR,CTC-Decoder,CUDA-CTC-Decoder

165
166
167
168
169
170
171
.. customcarditem::
   :header: On device audio-visual automatic speech recognition
   :card_description: Learn how to stream audio and video from laptop webcam and perform audio-visual automatic speech recognition using Emformer-RNNT model.
   :image: https://download.pytorch.org/torchaudio/doc-assets/avsr/transformed.gif
   :link: tutorials/device_avsr.html
   :tags: I/O,Pipelines,RNNT

moto's avatar
moto committed
172
173
174
175
176
177
178
.. customcarditem::
   :header: Loading waveform Tensors from files and saving them
   :card_description: Learn how to query/load audio files and save waveform tensors to files, using <code>torchaudio.info</code>, <code>torchaudio.load</code> and <code>torchaudio.save</code> functions.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/audio_io_tutorial.png
   :link: tutorials/audio_io_tutorial.html
   :tags: I/O

179
180
181
182
183
184
185
.. customcarditem::
   :header: CTC Forced Alignment API
   :card_description: Learn how to use TorchAudio's CTC forced alignment API (<code>torchaudio.functional.forced_align</code>).
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/ctc_forced_alignment_api_tutorial.png
   :link: tutorials/ctc_forced_alignment_api_tutorial.html
   :tags: CTC,Forced-Alignment

186
187
188
189
190
191
192
.. customcarditem::
   :header: Forced alignment for multilingual data
   :card_description: Learn how to use align multiligual data using TorchAudio's CTC forced alignment API (<code>torchaudio.functional.forced_align</code>) and a multiligual Wav2Vec2 model.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/forced_alignment_for_multilingual_data_tutorial.png
   :link: tutorials/forced_alignment_for_multilingual_data_tutorial.html
   :tags: Forced-Alignment

moto's avatar
moto committed
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
.. customcarditem::
   :header: Streaming media decoding with StreamReader
   :card_description: Learn how to load audio/video to Tensors using <code>torchaudio.io.StreamReader</code> class.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/streamreader_basic_tutorial.png
   :link: tutorials/streamreader_basic_tutorial.html
   :tags: I/O,StreamReader

.. customcarditem::
   :header: Device input, synthetic audio/video, and filtering with StreamReader
   :card_description: Learn how to load media from hardware devices, generate synthetic audio/video, and apply filters to them with <code>torchaudio.io.StreamReader</code>.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/streamreader_advanced_tutorial.gif
   :link: tutorials/streamreader_advanced_tutorial.html
   :tags: I/O,StreamReader

.. customcarditem::
   :header: Streaming media encoding with StreamWriter
   :card_description: Learn how to save audio/video with <code>torchaudio.io.StreamWriter</code>.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/streamwriter_basic_tutorial.gif
   :link: tutorials/streamwriter_basic_tutorial.html
   :tags: I/O,StreamWriter
Yuekai Zhang's avatar
Yuekai Zhang committed
213

moto's avatar
moto committed
214
215
216
217
218
219
220
.. customcarditem::
   :header: Playing media with StreamWriter
   :card_description: Learn how to play audio/video with <code>torchaudio.io.StreamWriter</code>.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/streamwriter_advanced.gif
   :link: tutorials/streamwriter_advanced.html
   :tags: I/O,StreamWriter

221
222
223
224
225
226
227
.. customcarditem::
   :header: Hardware accelerated video decoding with NVDEC
   :card_description: Learn how to use HW video decoder.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/hw_acceleration_tutorial.png
   :link: tutorials/nvdec_tutorial.html
   :tags: I/O,StreamReader

moto's avatar
moto committed
228
.. customcarditem::
moto's avatar
moto committed
229
230
   :header: Hardware accelerated video encoding with NVENC
   :card_description: Learn how to use HW video encoder.
moto's avatar
moto committed
231
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/hw_acceleration_tutorial.png
moto's avatar
moto committed
232
233
   :link: tutorials/nvenc_tutorial.html
   :tags: I/O,StreamWriter
moto's avatar
moto committed
234

moto's avatar
moto committed
235
236
237
238
239
240
241
.. customcarditem::
   :header: Apply effects and codecs to waveform
   :card_description: Learn how to apply effects and codecs to waveform using <code>torchaudio.io.AudioEffector</code>.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/effector_tutorial.png
   :link: tutorials/effector_tutorial.html
   :tags: Preprocessing

moto's avatar
moto committed
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
.. customcarditem::
   :header: Audio resampling with bandlimited sinc interpolation
   :card_description: Learn how to resample audio tensor with <code>torchaudio.functional.resample</code> and <code>torchaudio.transforms.Resample</code>.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/audio_resampling_tutorial.png
   :link: tutorials/audio_resampling_tutorial.html
   :tags: Preprocessing

.. customcarditem::
   :header: Audio data augmentation
   :card_description: Learn how to use <code>torchaudio.functional</code> and <code>torchaudio.transforms</code> modules to perform data augmentation.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/audio_data_augmentation_tutorial.png
   :link: tutorials/audio_data_augmentation_tutorial.html
   :tags: Preprocessing

.. customcarditem::
   :header: Audio feature extraction
   :card_description: Learn how to use <code>torchaudio.functional</code> and <code>torchaudio.transforms</code> modules to extract features from waveform.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/audio_feature_extractions_tutorial.png
   :link: tutorials/audio_feature_extractions_tutorial.html
   :tags: Preprocessing

.. customcarditem::
   :header: Audio feature augmentation
   :card_description: Learn how to use <code>torchaudio.functional</code> and <code>torchaudio.transforms</code> modules to perform feature augmentation.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/audio_feature_augmentation_tutorial.png
   :link: tutorials/audio_feature_augmentation_tutorial.html
   :tags: Preprocessing

moto's avatar
moto committed
270
271
272
273
274
275
276
.. customcarditem::
   :header: Generating waveforms with oscillator
   :card_description:
   :image: _images/sphx_glr_oscillator_tutorial_003.png
   :link: tutorials/oscillator_tutorial.html
   :tags: DSP

moto's avatar
moto committed
277
278
279
280
281
282
283
.. customcarditem::
   :header: Additive Synthesis
   :card_description:
   :image: _images/sphx_glr_additive_synthesis_tutorial_001.png
   :link: tutorials/additive_synthesis_tutorial.html
   :tags: DSP

moto's avatar
moto committed
284
285
286
287
288
289
290
.. customcarditem::
   :header: Designing digital filters
   :card_description:
   :image: _images/sphx_glr_filter_design_tutorial_001.png
   :link: tutorials/filter_design_tutorial.html
   :tags: DSP

291
292
293
294
295
296
297
.. customcarditem::
   :header: Subtractive Synthesis
   :card_description:
   :image: _images/sphx_glr_subtractive_synthesis_tutorial_002.png
   :link: tutorials/subtractive_synthesis_tutorial.html
   :tags: DSP

moto's avatar
moto committed
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
.. customcarditem::
   :header: Audio dataset
   :card_description: Learn how to use <code>torchaudio.datasets</code> module.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/audio_datasets_tutorial.png
   :link: tutorials/audio_datasets_tutorial.html
   :tags: Dataset

.. customcarditem::
   :header: AM inference with Wav2Vec2
   :card_description: Learn how to perform acoustic model inference with Wav2Vec2 (<code>torchaudio.pipelines.Wav2Vec2ASRBundle</code>).
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/speech_recognition_pipeline_tutorial.png
   :link: tutorials/speech_recognition_pipeline_tutorial.html
   :tags: ASR,wav2vec2

.. customcarditem::
   :header: LM inference with CTC Beam Seach Decoder
   :card_description: Learn how to perform ASR beam search decoding with lexicon and language model, using <code>torchaudio.models.decoder.ctc_decoder</code>.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/asr_inference_with_ctc_decoder_tutorial.png
   :link: tutorials/asr_inference_with_ctc_decoder_tutorial.html
   :tags: Pipelines,ASR,wav2vec2,CTC-Decoder

.. customcarditem::
   :header: Online ASR with Emformer RNN-T
   :card_description: Learn how to perform online ASR with Emformer RNN-T (<code>torchaudio.pipelines.RNNTBundle</code>) and <code>torchaudio.io.StreamReader</code>.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/online_asr_tutorial.gif
   :link: tutorials/online_asr_tutorial.html
   :tags: Pipelines,ASR,RNNT,StreamReader
Yuekai Zhang's avatar
Yuekai Zhang committed
325

moto's avatar
moto committed
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
.. customcarditem::
   :header: Real-time microphone ASR with Emformer RNN-T
   :card_description: Learn how to transcribe speech fomr microphone with Emformer RNN-T (<code>torchaudio.pipelines.RNNTBundle</code>) and <code>torchaudio.io.StreamReader</code>.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/device_asr.png
   :link: tutorials/device_asr.html
   :tags: Pipelines,ASR,RNNT,StreamReader

.. customcarditem::
   :header: Forced Alignment with Wav2Vec2
   :card_description: Learn how to align text to speech with Wav2Vec 2 (<code>torchaudio.pipelines.Wav2Vec2ASRBundle</code>).
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/forced_alignment_tutorial.png
   :link: tutorials/forced_alignment_tutorial.html
   :tags: Pipelines,Forced-Alignment,wav2vec2

.. customcarditem::
   :header: Text-to-Speech with Tacotron2
   :card_description: Learn how to generate speech from text with Tacotron2 (<code>torchaudio.pipelines.Tacotron2TTSBundle</code>).
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/tacotron2_pipeline_tutorial.png
   :link: tutorials/tacotron2_pipeline_tutorial.html
   :tags: Pipelines,TTS-(Text-to-Speech)
Yuekai Zhang's avatar
Yuekai Zhang committed
346

moto's avatar
moto committed
347
348
349
350
351
352
353
354
355
356
357
358
359
360
.. customcarditem::
   :header: Speech Enhancement with MVDR Beamforming
   :card_description: Learn how to improve speech quality with MVDR Beamforming.
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/mvdr_tutorial.png
   :link: tutorials/mvdr_tutorial.html
   :tags: Pipelines,Speech-Enhancement

.. customcarditem::
   :header: Music Source Separation with Hybrid Demucs
   :card_description: Learn how to perform music source separation with pre-trained Hybrid Demucs (<code>torchaudio.pipelines.SourceSeparationBundle</code>).
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/hybrid_demucs_tutorial.png
   :link: tutorials/hybrid_demucs_tutorial.html
   :tags: Pipelines,Source-Separation

361
362
363
364
365
366
.. customcarditem::
   :header: Torchaudio-Squim: Non-intrusive Speech Assessment in TorchAudio
   :card_description: Learn how to estimate subjective and objective metrics with pre-trained TorchAudio-SQUIM models (<code>torchaudio.pipelines.SQUIMObjective</code>).
   :image: https://download.pytorch.org/torchaudio/tutorial-assets/thumbnails/squim_tutorial.png
   :link: tutorials/squim_tutorial.html
   :tags: Pipelines,Speech Assessment,Speech Enhancement
moto's avatar
moto committed
367
.. customcardend::
368
369
370


Citing torchaudio
371
-----------------
372
373
374

If you find torchaudio useful, please cite the following paper:

moto's avatar
moto committed
375
376
377
378
379
-  Hwang, J., Hira, M., Chen, C., Zhang, X., Ni, Z., Sun, G., Ma, P., Huang, R., Pratap, V.,
   Zhang, Y., Kumar, A., Yu, C.-Y., Zhu, C., Liu, C., Kahn, J., Ravanelli, M., Sun, P.,
   Watanabe, S., Shi, Y., Tao, T., Scheibler, R., Cornell, S., Kim, S., & Petridis, S. (2023).
   TorchAudio 2.1: Advancing speech recognition, self-supervised learning, and audio processing components for PyTorch. arXiv preprint arXiv:2310.17864

380
381
382
383
384
385
386
387
- Yang, Y.-Y., Hira, M., Ni, Z., Chourdia, A., Astafurov, A., Chen, C., Yeh, C.-F., Puhrsch, C.,
  Pollack, D., Genzel, D., Greenberg, D., Yang, E. Z., Lian, J., Mahadeokar, J., Hwang, J.,
  Chen, J., Goldsborough, P., Roy, P., Narenthiran, S., Watanabe, S., Chintala, S.,
  Quenneville-Bélair, V, & Shi, Y. (2021).
  TorchAudio: Building Blocks for Audio and Speech Processing. arXiv preprint arXiv:2110.15018.

In BibTeX format:

moto's avatar
moto committed
388
389
390
391
392
393
394
395
396
397
398
.. code-block:: bibtex

   @misc{hwang2023torchaudio,
      title={TorchAudio 2.1: Advancing speech recognition, self-supervised learning, and audio processing components for PyTorch}, 
      author={Jeff Hwang and Moto Hira and Caroline Chen and Xiaohui Zhang and Zhaoheng Ni and Guangzhi Sun and Pingchuan Ma and Ruizhe Huang and Vineel Pratap and Yuekai Zhang and Anurag Kumar and Chin-Yun Yu and Chuang Zhu and Chunxi Liu and Jacob Kahn and Mirco Ravanelli and Peng Sun and Shinji Watanabe and Yangyang Shi and Yumeng Tao and Robin Scheibler and Samuele Cornell and Sean Kim and Stavros Petridis},
      year={2023},
      eprint={2310.17864},
      archivePrefix={arXiv},
      primaryClass={eess.AS}
   }

399
400
401
402
.. code-block:: bibtex

    @article{yang2021torchaudio,
      title={TorchAudio: Building Blocks for Audio and Speech Processing},
403
404
405
406
407
408
409
410
      author={Yao-Yuan Yang and Moto Hira and Zhaoheng Ni and
              Anjali Chourdia and Artyom Astafurov and Caroline Chen and
              Ching-Feng Yeh and Christian Puhrsch and David Pollack and
              Dmitriy Genzel and Donny Greenberg and Edward Z. Yang and
              Jason Lian and Jay Mahadeokar and Jeff Hwang and Ji Chen and
              Peter Goldsborough and Prabhat Roy and Sean Narenthiran and
              Shinji Watanabe and Soumith Chintala and
              Vincent Quenneville-Bélair and Yangyang Shi},
411
412
413
      journal={arXiv preprint arXiv:2110.15018},
      year={2021}
    }