Skip to content

Commit dbf9c2a

Browse files
committed
Add deprecation warnings to libsox specific functions
1 parent fd6e044 commit dbf9c2a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

torchaudio/backend/sox_backend.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ def info(filepath: str) -> Tuple[SignalInfo, EncodingInfo]:
9292

9393

9494
@_mod_utils.requires_module('torchaudio._torchaudio')
95+
@_mod_utils.deprecated(
96+
'Please migrate to "sox_io" backend. See https://github.com/pytorch/audio/issues/903 for the detail',
97+
'0.9.0')
9598
def save_encinfo(filepath: str,
9699
src: Tensor,
97100
channels_first: bool = True,
@@ -163,6 +166,9 @@ def save_encinfo(filepath: str,
163166

164167

165168
@_mod_utils.requires_module('torchaudio._torchaudio')
169+
@_mod_utils.deprecated(
170+
'Please migrate to "sox_io" backend. See https://github.com/pytorch/audio/issues/903 for the detail',
171+
'0.9.0')
166172
def sox_signalinfo_t() -> SignalInfo:
167173
r"""Create a sox_signalinfo_t object. This object can be used to set the sample
168174
rate, number of channels, length, bit precision and headroom multiplier
@@ -186,6 +192,9 @@ def sox_signalinfo_t() -> SignalInfo:
186192

187193

188194
@_mod_utils.requires_module('torchaudio._torchaudio')
195+
@_mod_utils.deprecated(
196+
'Please migrate to "sox_io" backend. See https://github.com/pytorch/audio/issues/903 for the detail',
197+
'0.9.0')
189198
def sox_encodinginfo_t() -> EncodingInfo:
190199
r"""Create a sox_encodinginfo_t object. This object can be used to set the encoding
191200
type, bit precision, compression factor, reverse bytes, reverse nibbles,
@@ -224,6 +233,9 @@ def sox_encodinginfo_t() -> EncodingInfo:
224233

225234

226235
@_mod_utils.requires_module('torchaudio._torchaudio')
236+
@_mod_utils.deprecated(
237+
'Please migrate to "sox_io" backend. See https://github.com/pytorch/audio/issues/903 for the detail',
238+
'0.9.0')
227239
def get_sox_encoding_t(i: int = None) -> EncodingInfo:
228240
r"""Get enum of sox_encoding_t for sox encodings.
229241
@@ -242,6 +254,9 @@ def get_sox_encoding_t(i: int = None) -> EncodingInfo:
242254

243255

244256
@_mod_utils.requires_module('torchaudio._torchaudio')
257+
@_mod_utils.deprecated(
258+
'Please migrate to "sox_io" backend. See https://github.com/pytorch/audio/issues/903 for the detail',
259+
'0.9.0')
245260
def get_sox_option_t(i: int = 2) -> Any:
246261
r"""Get enum of sox_option_t for sox encodinginfo options.
247262
@@ -259,6 +274,9 @@ def get_sox_option_t(i: int = 2) -> Any:
259274

260275

261276
@_mod_utils.requires_module('torchaudio._torchaudio')
277+
@_mod_utils.deprecated(
278+
'Please migrate to "sox_io" backend. See https://github.com/pytorch/audio/issues/903 for the detail',
279+
'0.9.0')
262280
def get_sox_bool(i: int = 0) -> Any:
263281
r"""Get enum of sox_bool for sox encodinginfo options.
264282

0 commit comments

Comments
 (0)