Skip to content

Commit 826b994

Browse files
committed
Deprecate torchaudio.USE_SOUNDFILE_LEGACY_INTERFACE
1 parent 68614e8 commit 826b994

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

torchaudio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
transforms
1010
)
1111

12-
USE_SOUNDFILE_LEGACY_INTERFACE = False
12+
USE_SOUNDFILE_LEGACY_INTERFACE = None
1313

1414
from torchaudio.backend import (
1515
list_audio_backends,

torchaudio/backend/utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ def set_audio_backend(backend: Optional[str]):
4242
One of ``"sox"``, ``"sox_io"`` or ``"soundfile"`` based on availability
4343
of the system. If ``None`` is provided the current backend is unassigned.
4444
"""
45+
if torchaudio.USE_SOUNDFILE_LEGACY_INTERFACE is not None:
46+
warnings.warn(
47+
'"torchaudio.USE_SOUNDFILE_LEGACY_INTERFACE" flag is depredated and will be removed in 0.9.0. '
48+
'Please remove the use of flag.'
49+
)
50+
4551
if backend is not None and backend not in list_audio_backends():
4652
raise RuntimeError(
4753
f'Backend "{backend}" is not one of '

0 commit comments

Comments
 (0)