Skip to content

Commit 33dc817

Browse files
authored
Remove legacy backends (#1311)
1 parent 086467a commit 33dc817

File tree

22 files changed

+434
-1834
lines changed

22 files changed

+434
-1834
lines changed

docs/source/backend.rst

Lines changed: 3 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,18 @@ Overview
1111
There are currently four implementations available.
1212

1313
* :ref:`"sox_io" <sox_io_backend>` (default on Linux/macOS)
14-
* :ref:`"sox" <sox_backend>` (deprecated, will be removed in 0.9.0 release)
1514
* :ref:`"soundfile" <soundfile_backend>` (default on Windows)
16-
* :ref:`"soundfile" (legacy interface) <soundfile_legacy_backend>` (deprecated, will be removed in 0.9.0 release)
17-
18-
The use of ``"sox"`` backend is strongly discouraged as it cannot correctly handle formats other than 16-bit integer WAV. See `#726 <https://github.com/pytorch/audio/pull/726>`_ for the detail.
1915

2016
.. note::
2117
Instead of calling functions in ``torchaudio.backend`` directly, please use ``torchaudio.info``, ``torchaudio.load``, ``torchaudio.load_wav`` and ``torchaudio.save`` with proper backend set with :func:`torchaudio.set_audio_backend`.
2218

2319
Availability
2420
------------
2521

26-
``"sox"`` and ``"sox_io"`` backends require C++ extension module, which is included in Linux/macOS binary distributions. These backends are not available on Windows.
22+
``"sox_io"`` backend requires C++ extension module, which is included in Linux/macOS binary distributions. This backend is not available on Windows.
2723

2824
``"soundfile"`` backend requires ``SoundFile``. Please refer to `the SoundFile documentation <https://pysoundfile.readthedocs.io/en/latest/>`_ for the installation.
2925

30-
Changes in default backend and deprecation
31-
------------------------------------------
32-
33-
Backend module is going through a major overhaul. The following table summarizes the timeline for the deprecations and removals.
34-
35-
+--------------------+-----------------------+------------------------+
36-
| **Backend** | **0.8.0** | **0.9.0** |
37-
+====================+=======================+========================+
38-
| ``"sox_io"`` | Default on Linx/macOS | Default on Linux/macOS |
39-
+--------------------+-----------------------+------------------------+
40-
| ``"sox"`` | Available | Removed |
41-
| (deprecated) | | |
42-
+--------------------+-----------------------+------------------------+
43-
| ``"soundfile"`` | Default on Windows | Default on Windows |
44-
+--------------------+-----------------------+------------------------+
45-
| ``"soundfile"`` | Available | Removed |
46-
| (legacy interface, | | |
47-
| deprecated) | | |
48-
+--------------------+-----------------------+------------------------+
49-
50-
* The ``"sox"`` and ``"soundfile" (legacy interface)`` backends are deprecated and will be removed in 0.9.0 release.
51-
5226
Common Data Structure
5327
~~~~~~~~~~~~~~~~~~~~~
5428

@@ -59,16 +33,6 @@ AudioMetaData
5933

6034
.. autoclass:: torchaudio.backend.common.AudioMetaData
6135

62-
SignalInfo (Deprecated)
63-
-----------------------
64-
65-
.. autoclass:: torchaudio.backend.common.SignalInfo
66-
67-
EncodingInfo (Deprecated)
68-
-------------------------
69-
70-
.. autoclass:: torchaudio.backend.common.EncodingInfo
71-
7236
.. _sox_io_backend:
7337

7438
Sox IO Backend
@@ -102,44 +66,6 @@ save
10266

10367
.. autofunction:: torchaudio.backend.sox_io_backend.save
10468

105-
.. _sox_backend:
106-
107-
Sox Backend (Deprecated)
108-
~~~~~~~~~~~~~~~~~~~~~~~~
109-
110-
The ``"sox"`` backend is available on Linux/macOS and not available on Windows. This backend is deprecated and will be removed in ``0.9.0`` release.
111-
112-
You can switch from another backend to ``sox`` backend with the following;
113-
114-
.. code::
115-
116-
torchaudio.set_audio_backend("sox")
117-
118-
info
119-
----
120-
121-
.. autofunction:: torchaudio.backend.sox_backend.info
122-
123-
load
124-
----
125-
126-
.. autofunction:: torchaudio.backend.sox_backend.load
127-
128-
.. autofunction:: torchaudio.backend.sox_backend.load_wav
129-
130-
131-
save
132-
----
133-
134-
.. autofunction:: torchaudio.backend.sox_backend.save
135-
136-
others
137-
------
138-
139-
.. automodule:: torchaudio.backend.sox_backend
140-
:members:
141-
:exclude-members: info, load, load_wav, save
142-
14369
.. _soundfile_backend:
14470

14571
Soundfile Backend
@@ -153,55 +79,20 @@ You can switch from another backend to the ``"soundfile"`` backend with the foll
15379
15480
torchaudio.set_audio_backend("soundfile")
15581
156-
.. note::
157-
If you are switching from `"soundfile" (legacy interface) <soundfile_legacy_backend>` backend, set ``torchaudio.USE_SOUNDFILE_LEGACY_INTERFACE`` flag **before** switching the backend.
158-
15982
info
16083
----
16184

162-
.. autofunction:: torchaudio.backend._soundfile_backend.info
163-
164-
load
165-
----
166-
167-
.. autofunction:: torchaudio.backend._soundfile_backend.load
168-
169-
.. autofunction:: torchaudio.backend._soundfile_backend.load_wav
170-
171-
172-
save
173-
----
174-
175-
.. autofunction:: torchaudio.backend._soundfile_backend.save
176-
177-
.. _soundfile_legacy_backend:
178-
179-
Legacy Interface (Deprecated)
180-
-----------------------------
181-
182-
``"soundfile"`` backend with legacy interface is made available for backward compatibility reason, however this interface is deprecated and will be removed in the ``0.9.0`` release.
183-
184-
To switch to this backend/interface, set ``torchaudio.USE_SOUNDFILE_LEGACY_INTERFACE`` flag **before** switching the backend.
185-
186-
.. code::
187-
188-
torchaudio.USE_SOUNDFILE_LEGACY_INTERFACE = True
189-
torchaudio.set_audio_backend("soundfile") # The legacy interface
190-
191-
info
192-
^^^^
193-
19485
.. autofunction:: torchaudio.backend.soundfile_backend.info
19586

19687
load
197-
^^^^
88+
----
19889

19990
.. autofunction:: torchaudio.backend.soundfile_backend.load
20091

20192
.. autofunction:: torchaudio.backend.soundfile_backend.load_wav
20293

20394

20495
save
205-
^^^^
96+
----
20697

20798
.. autofunction:: torchaudio.backend.soundfile_backend.save

0 commit comments

Comments
 (0)