Unverified Commit 8181a83b authored by moto's avatar moto Committed by GitHub
Browse files

Add deprication warnings to SoxEffect and SoxEffectsChain (#787)

parent 60a8e23d
...@@ -48,7 +48,7 @@ def deprecated(direction: str, version: Optional[str] = None): ...@@ -48,7 +48,7 @@ def deprecated(direction: str, version: Optional[str] = None):
def wrapped(*args, **kwargs): def wrapped(*args, **kwargs):
message = ( message = (
f'{func.__module__}.{func.__name__} has been deprecated ' f'{func.__module__}.{func.__name__} has been deprecated '
f'and will be removed from {"future" if version is None else version} release.' f'and will be removed from {"future" if version is None else version} release. '
f'{direction}') f'{direction}')
warnings.warn(message, stacklevel=2) warnings.warn(message, stacklevel=2)
return func(*args, **kwargs) return func(*args, **kwargs)
......
...@@ -179,9 +179,14 @@ def apply_effects_file( ...@@ -179,9 +179,14 @@ def apply_effects_file(
@_mod_utils.requires_module('torchaudio._torchaudio') @_mod_utils.requires_module('torchaudio._torchaudio')
@_mod_utils.deprecated('Please migrate to `apply_effects_file` or `apply_effects_tensor`.')
def SoxEffect(): def SoxEffect():
r"""Create an object for passing sox effect information between python and c++ r"""Create an object for passing sox effect information between python and c++
Note:
This function is deprecated.
Please migrate to :func:`apply_effects_file` or :func:`apply_effects_tensor`.
Returns: Returns:
SoxEffect: An object with the following attributes: ename (str) which is the SoxEffect: An object with the following attributes: ename (str) which is the
name of effect, and eopts (List[str]) which is a list of effect options. name of effect, and eopts (List[str]) which is a list of effect options.
...@@ -189,9 +194,14 @@ def SoxEffect(): ...@@ -189,9 +194,14 @@ def SoxEffect():
return _torchaudio.SoxEffect() return _torchaudio.SoxEffect()
@_mod_utils.deprecated('Please migrate to `apply_effects_file` or `apply_effects_tensor`.')
class SoxEffectsChain(object): class SoxEffectsChain(object):
r"""SoX effects chain class. r"""SoX effects chain class.
Note:
This class is deprecated.
Please migrate to :func:`apply_effects_file` or :func:`apply_effects_tensor`.
Args: Args:
normalization (bool, number, or callable, optional): If boolean `True`, then output is divided by `1 << 31` normalization (bool, number, or callable, optional): If boolean `True`, then output is divided by `1 << 31`
(assumes signed 32-bit audio), and normalizes to `[-1, 1]`. If `number`, then output is divided by that (assumes signed 32-bit audio), and normalizes to `[-1, 1]`. If `number`, then output is divided by that
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment