Skip to content

Commit 66ddb19

Browse files
committed
Misc cleanups
1 parent 119eaad commit 66ddb19

File tree

6 files changed

+7
-198
lines changed

6 files changed

+7
-198
lines changed

docs/source/torchaudio.rst

Lines changed: 3 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ torchaudio
44
.. currentmodule:: torchaudio
55

66
.. warning::
7-
Starting with version 2.8, we are refactoring TorchAudio to transition it
8-
into a maintenance phase. As a result:
7+
Starting with version 2.9, we have transitioned TorchAudio into a maintenance phase. As a result:
98

10-
- Most APIs listed below are deprecated in 2.8 and will be removed in 2.9.
9+
- APIs deprecated in version 2.8 have been removed in 2.9.
1110
- The decoding and encoding capabilities of PyTorch for both audio and video
12-
are being consolidated into TorchCodec. For convenience, we provide
11+
have been consolidated into TorchCodec. For convenience, we provide
1312
:func:`~torchaudio.load_with_torchcodec` as a replacement for
1413
:func:`~torchaudio.load` and :func:`~torchaudio.save_with_torchcodec` as a
1514
replacement for :func:`~torchaudio.save`, but we recommend that you port
@@ -34,75 +33,3 @@ it easy to handle audio data.
3433
save
3534
save_with_torchcodec
3635
list_audio_backends
37-
38-
.. _backend:
39-
40-
Backend and Dispatcher
41-
----------------------
42-
43-
Decoding and encoding media is highly elaborated process. Therefore, TorchAudio
44-
relies on third party libraries to perform these operations. These third party
45-
libraries are called ``backend``, and currently TorchAudio integrates the
46-
following libraries.
47-
48-
Please refer to `Installation <./installation.html>`__ for how to enable backends.
49-
50-
Conventionally, TorchAudio has had its I/O backend set globally at runtime
51-
based on availability. However, this approach does not allow applications to
52-
use different backends, and it is not well-suited for large codebases.
53-
54-
For these reasons, in v2.0, we introduced a dispatcher, a new mechanism to allow
55-
users to choose a backend for each function call.
56-
57-
When dispatcher mode is enabled, all the I/O functions accept extra keyward argument
58-
``backend``, which specifies the desired backend. If the specified
59-
backend is not available, the function call will fail.
60-
61-
If a backend is not explicitly chosen, the functions will select a backend to use given order of precedence and library availability.
62-
63-
The following table summarizes the backends.
64-
65-
.. list-table::
66-
:header-rows: 1
67-
:widths: 8 12 25 60
68-
69-
* - Priority
70-
- Backend
71-
- Supported OS
72-
- Note
73-
* - 1
74-
- FFmpeg
75-
- Linux, macOS, Windows
76-
77-
This backend Supports various protocols, such as HTTPS and MP4, and file-like objects.
78-
* - 3
79-
- SoundFile
80-
- Linux, macOS, Windows
81-
- Please refer to `the official document <https://pysoundfile.readthedocs.io/>`__ for the supported codecs.
82-
83-
This backend supports file-like objects.
84-
85-
.. _dispatcher_migration:
86-
87-
Dispatcher Migration
88-
~~~~~~~~~~~~~~~~~~~~
89-
90-
We are migrating the I/O functions to use the dispatcher mechanism, and this
91-
incurs multiple changes, some of which involve backward-compatibility-breaking
92-
changes, and require users to change their function call.
93-
94-
The (planned) changes are as follows. For up-to-date information,
95-
please refer to https://github.com/pytorch/audio/issues/2950
96-
97-
* In 2.0, audio I/O backend dispatcher was introduced.
98-
Users can opt-in to using dispatcher by setting the environment variable
99-
``TORCHAUDIO_USE_BACKEND_DISPATCHER=1``.
100-
* In 2.1, the disptcher became the default mechanism for I/O.
101-
* In 2.2, the legacy global backend mechanism is removed.
102-
Utility functions :py:func:`get_audio_backend` and :py:func:`set_audio_backend`
103-
became no-op.
104-
105-
Furthermore, we removed file-like object support from libsox backend, as this
106-
is better supported by FFmpeg backend and makes the build process simpler.
107-
Therefore, beginning with 2.1, FFmpeg and Soundfile are the sole backends that support
108-
file-like objects.

docs/source/utils.rst

Lines changed: 0 additions & 23 deletions
This file was deleted.

examples/libtorchaudio/speech_recognition/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
This example demonstarates how you can use torchaudio's I/O features and models to run speech recognition in C++ application.
44

5-
**NOTE**
6-
This example uses `"sox_io"` backend for loading audio, which does not work on Windows. To make it work on
7-
Windows, you need to replace the part of loading audio and converting it to Tensor object.
8-
95
## 1. Create a transcription pipeline TorchScript file
106

117
We will create a TorchScript that performs the following processes;

packaging/torchaudio/meta.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ build:
5050
test:
5151
imports:
5252
- torchaudio
53-
- torchaudio.io
5453
- torchaudio.datasets
55-
- torchaudio.sox_effects
5654
- torchaudio.transforms
5755

5856
source_files:

test/torchaudio_unittest/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ Some useful pytest commands:
2121
pytest test --collect-only
2222
# Run all the test suites
2323
pytest test
24-
# Run tests on sox_effects module
25-
pytest test/torchaudio_unittest/sox_effect
2624
# use -k to apply filter
27-
pytest test/torchaudio_unittest/sox_io_backend -k load # only runs tests where their names contain load
25+
pytest test/torchaudio_unittest/test_load_save_torchcodec.py -k load # only runs tests where their names contain load
2826
# Some other useful options;
2927
# Stop on the first failure -x
3028
# Run failure fast --ff
@@ -67,8 +65,6 @@ The following test modules are defined for corresponding `torchaudio` module/fun
6765
- [`torchaudio.functional`](./functional)
6866
- [`torchaudio.transforms`](./transforms/transforms_test.py)
6967
- [`torchaudio.compliance.kaldi`](./compliance_kaldi_test.py)
70-
- [`torchaudio.kaldi_io`](./kaldi_io_test.py)
71-
- [`torchaudio.sox_effects`](./sox_effect)
7268
- [`torchaudio.backend`](./backend)
7369

7470
### Test modules that do not fall into the above categories
@@ -79,6 +75,9 @@ The following test modules are defined for corresponding `torchaudio` module/fun
7975
- [assets](./assets): Contain sample audio files.
8076
- [assets/kaldi](./assets/kaldi): Contains Kaldi format matrix files used in [./test_compliance_kaldi.py](./test_compliance_kaldi.py).
8177
- [compliance](./compliance): Scripts used to generate above Kaldi matrix files.
78+
- [assets/kaldi_expected_results](./assets/kaldi_expected_results): Contains outputs from Kaldi to compare against torchaudio functionality in [./compliance/kaldi](./compliance/kaldi).
79+
- [assets/librosa_expected_results](./assets/librosa_expected_results): Contains outputs from Librosa to compare against torchaudio functionality.
80+
- [assets/sox_expected_results](./assets/sox_expected_results): Contains outputs from Sox to compare against torchaudio functionality.
8281

8382
### Waveforms for Testing Purposes
8483

test/torchaudio_unittest/assets/sox_effect_test_args.jsonl

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)