torchaudio 2.8.0__cp313-cp313-win_amd64.whl → 2.9.0__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of torchaudio might be problematic. Click here for more details.
- torchaudio/__init__.py +179 -39
- torchaudio/_extension/__init__.py +1 -14
- torchaudio/_extension/utils.py +0 -47
- torchaudio/_internal/module_utils.py +12 -3
- torchaudio/_torchcodec.py +73 -85
- torchaudio/datasets/cmuarctic.py +1 -1
- torchaudio/datasets/utils.py +1 -1
- torchaudio/functional/__init__.py +0 -2
- torchaudio/functional/_alignment.py +1 -1
- torchaudio/functional/filtering.py +70 -55
- torchaudio/functional/functional.py +26 -60
- torchaudio/lib/_torchaudio.pyd +0 -0
- torchaudio/lib/libtorchaudio.pyd +0 -0
- torchaudio/models/decoder/__init__.py +14 -2
- torchaudio/models/decoder/_ctc_decoder.py +6 -6
- torchaudio/models/decoder/_cuda_ctc_decoder.py +1 -1
- torchaudio/models/squim/objective.py +2 -2
- torchaudio/pipelines/_source_separation_pipeline.py +1 -1
- torchaudio/pipelines/_squim_pipeline.py +2 -2
- torchaudio/pipelines/_tts/utils.py +1 -1
- torchaudio/pipelines/rnnt_pipeline.py +4 -4
- torchaudio/transforms/__init__.py +1 -0
- torchaudio/transforms/_transforms.py +2 -2
- torchaudio/utils/__init__.py +2 -9
- torchaudio/utils/download.py +1 -3
- torchaudio/version.py +2 -2
- {torchaudio-2.8.0.dist-info → torchaudio-2.9.0.dist-info}/METADATA +8 -11
- torchaudio-2.9.0.dist-info/RECORD +85 -0
- {torchaudio-2.8.0.dist-info → torchaudio-2.9.0.dist-info}/top_level.txt +0 -1
- torchaudio/_backend/__init__.py +0 -61
- torchaudio/_backend/backend.py +0 -53
- torchaudio/_backend/common.py +0 -52
- torchaudio/_backend/ffmpeg.py +0 -334
- torchaudio/_backend/soundfile.py +0 -54
- torchaudio/_backend/soundfile_backend.py +0 -457
- torchaudio/_backend/sox.py +0 -91
- torchaudio/_backend/utils.py +0 -350
- torchaudio/backend/__init__.py +0 -8
- torchaudio/backend/_no_backend.py +0 -25
- torchaudio/backend/_sox_io_backend.py +0 -294
- torchaudio/backend/common.py +0 -13
- torchaudio/backend/no_backend.py +0 -14
- torchaudio/backend/soundfile_backend.py +0 -14
- torchaudio/backend/sox_io_backend.py +0 -14
- torchaudio/io/__init__.py +0 -20
- torchaudio/io/_effector.py +0 -347
- torchaudio/io/_playback.py +0 -72
- torchaudio/kaldi_io.py +0 -150
- torchaudio/prototype/__init__.py +0 -0
- torchaudio/prototype/datasets/__init__.py +0 -4
- torchaudio/prototype/datasets/musan.py +0 -68
- torchaudio/prototype/functional/__init__.py +0 -26
- torchaudio/prototype/functional/_dsp.py +0 -441
- torchaudio/prototype/functional/_rir.py +0 -382
- torchaudio/prototype/functional/functional.py +0 -193
- torchaudio/prototype/models/__init__.py +0 -39
- torchaudio/prototype/models/_conformer_wav2vec2.py +0 -801
- torchaudio/prototype/models/_emformer_hubert.py +0 -337
- torchaudio/prototype/models/conv_emformer.py +0 -529
- torchaudio/prototype/models/hifi_gan.py +0 -342
- torchaudio/prototype/models/rnnt.py +0 -717
- torchaudio/prototype/models/rnnt_decoder.py +0 -402
- torchaudio/prototype/pipelines/__init__.py +0 -21
- torchaudio/prototype/pipelines/_vggish/__init__.py +0 -7
- torchaudio/prototype/pipelines/_vggish/_vggish_impl.py +0 -236
- torchaudio/prototype/pipelines/_vggish/_vggish_pipeline.py +0 -83
- torchaudio/prototype/pipelines/hifigan_pipeline.py +0 -233
- torchaudio/prototype/pipelines/rnnt_pipeline.py +0 -58
- torchaudio/prototype/transforms/__init__.py +0 -9
- torchaudio/prototype/transforms/_transforms.py +0 -461
- torchaudio/sox_effects/__init__.py +0 -10
- torchaudio/sox_effects/sox_effects.py +0 -275
- torchaudio/utils/ffmpeg_utils.py +0 -11
- torchaudio/utils/sox_utils.py +0 -118
- torchaudio-2.8.0.dist-info/RECORD +0 -145
- torio/__init__.py +0 -8
- torio/_extension/__init__.py +0 -13
- torio/_extension/utils.py +0 -147
- torio/io/__init__.py +0 -9
- torio/io/_streaming_media_decoder.py +0 -977
- torio/io/_streaming_media_encoder.py +0 -502
- torio/lib/__init__.py +0 -0
- torio/lib/_torio_ffmpeg4.pyd +0 -0
- torio/lib/_torio_ffmpeg5.pyd +0 -0
- torio/lib/_torio_ffmpeg6.pyd +0 -0
- torio/lib/libtorio_ffmpeg4.pyd +0 -0
- torio/lib/libtorio_ffmpeg5.pyd +0 -0
- torio/lib/libtorio_ffmpeg6.pyd +0 -0
- torio/utils/__init__.py +0 -4
- torio/utils/ffmpeg_utils.py +0 -275
- {torchaudio-2.8.0.dist-info → torchaudio-2.9.0.dist-info}/WHEEL +0 -0
- {torchaudio-2.8.0.dist-info → torchaudio-2.9.0.dist-info}/licenses/LICENSE +0 -0
torio/_extension/utils.py
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import importlib
|
|
2
|
-
import logging
|
|
3
|
-
import os
|
|
4
|
-
import types
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
import torch
|
|
8
|
-
|
|
9
|
-
_LG = logging.getLogger(__name__)
|
|
10
|
-
_LIB_DIR = Path(__file__).parent.parent / "lib"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class _LazyImporter(types.ModuleType):
|
|
14
|
-
"""Lazily import module/extension."""
|
|
15
|
-
|
|
16
|
-
def __init__(self, name, import_func):
|
|
17
|
-
super().__init__(name)
|
|
18
|
-
self.import_func = import_func
|
|
19
|
-
self.module = None
|
|
20
|
-
|
|
21
|
-
# Note:
|
|
22
|
-
# Python caches what was retrieved with `__getattr__`, so this method will not be
|
|
23
|
-
# called again for the same item.
|
|
24
|
-
def __getattr__(self, item):
|
|
25
|
-
self._import_once()
|
|
26
|
-
return getattr(self.module, item)
|
|
27
|
-
|
|
28
|
-
def __repr__(self):
|
|
29
|
-
if self.module is None:
|
|
30
|
-
return f"<module '{self.__module__}.{self.__class__.__name__}(\"{self.name}\")'>"
|
|
31
|
-
return repr(self.module)
|
|
32
|
-
|
|
33
|
-
def __dir__(self):
|
|
34
|
-
self._import_once()
|
|
35
|
-
return dir(self.module)
|
|
36
|
-
|
|
37
|
-
def _import_once(self):
|
|
38
|
-
if self.module is None:
|
|
39
|
-
self.module = self.import_func()
|
|
40
|
-
# Note:
|
|
41
|
-
# By attaching the module attributes to self,
|
|
42
|
-
# module attributes are directly accessible.
|
|
43
|
-
# This allows to avoid calling __getattr__ for every attribute access.
|
|
44
|
-
self.__dict__.update(self.module.__dict__)
|
|
45
|
-
|
|
46
|
-
def is_available(self):
|
|
47
|
-
try:
|
|
48
|
-
self._import_once()
|
|
49
|
-
except Exception:
|
|
50
|
-
return False
|
|
51
|
-
return True
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def _get_lib_path(lib: str):
|
|
55
|
-
suffix = "pyd" if os.name == "nt" else "so"
|
|
56
|
-
path = _LIB_DIR / f"{lib}.{suffix}"
|
|
57
|
-
return path
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def _load_lib(lib: str) -> bool:
|
|
61
|
-
"""Load extension module
|
|
62
|
-
|
|
63
|
-
Note:
|
|
64
|
-
In case `torio` is deployed with `pex` format, the library file
|
|
65
|
-
is not in a standard location.
|
|
66
|
-
In this case, we expect that `libtorio` is available somewhere
|
|
67
|
-
in the search path of dynamic loading mechanism, so that importing
|
|
68
|
-
`_torio` will have library loader find and load `libtorio`.
|
|
69
|
-
This is the reason why the function should not raising an error when the library
|
|
70
|
-
file is not found.
|
|
71
|
-
|
|
72
|
-
Returns:
|
|
73
|
-
bool:
|
|
74
|
-
True if the library file is found AND the library loaded without failure.
|
|
75
|
-
False if the library file is not found (like in the case where torio
|
|
76
|
-
is deployed with pex format, thus the shared library file is
|
|
77
|
-
in a non-standard location.).
|
|
78
|
-
If the library file is found but there is an issue loading the library,
|
|
79
|
-
(such as missing dependency) then this function raises the exception as-is.
|
|
80
|
-
|
|
81
|
-
Raises:
|
|
82
|
-
Exception:
|
|
83
|
-
If the library file is found, but there is an issue loading the library file,
|
|
84
|
-
(when underlying `ctype.DLL` throws an exception), this function will pass
|
|
85
|
-
the exception as-is, instead of catching it and returning bool.
|
|
86
|
-
The expected case is `OSError` thrown by `ctype.DLL` when a dynamic dependency
|
|
87
|
-
is not found.
|
|
88
|
-
This behavior was chosen because the expected failure case is not recoverable.
|
|
89
|
-
If a dependency is missing, then users have to install it.
|
|
90
|
-
"""
|
|
91
|
-
path = _get_lib_path(lib)
|
|
92
|
-
if not path.exists():
|
|
93
|
-
return False
|
|
94
|
-
torch.ops.load_library(path)
|
|
95
|
-
return True
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
_FFMPEG_VERS = ["6", "5", "4", ""]
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
def _find_versionsed_ffmpeg_extension(version: str):
|
|
102
|
-
ext = f"torio.lib._torio_ffmpeg{version}"
|
|
103
|
-
lib = f"libtorio_ffmpeg{version}"
|
|
104
|
-
|
|
105
|
-
if not importlib.util.find_spec(ext):
|
|
106
|
-
raise RuntimeError(f"FFmpeg{version} extension is not available.")
|
|
107
|
-
|
|
108
|
-
_load_lib(lib)
|
|
109
|
-
return importlib.import_module(ext)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
def _find_ffmpeg_extension(ffmpeg_vers):
|
|
113
|
-
for ffmpeg_ver in ffmpeg_vers:
|
|
114
|
-
_LG.debug("Loading FFmpeg%s", ffmpeg_ver)
|
|
115
|
-
try:
|
|
116
|
-
ext = _find_versionsed_ffmpeg_extension(ffmpeg_ver)
|
|
117
|
-
_LG.debug("Successfully loaded FFmpeg%s", ffmpeg_ver)
|
|
118
|
-
return ext
|
|
119
|
-
except Exception:
|
|
120
|
-
_LG.debug("Failed to load FFmpeg%s extension.", ffmpeg_ver, exc_info=True)
|
|
121
|
-
continue
|
|
122
|
-
raise ImportError(
|
|
123
|
-
f"Failed to intialize FFmpeg extension. Tried versions: {ffmpeg_vers}. "
|
|
124
|
-
"Enable DEBUG logging to see more details about the error."
|
|
125
|
-
)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
def _get_ffmpeg_versions():
|
|
129
|
-
ffmpeg_vers = _FFMPEG_VERS
|
|
130
|
-
# User override
|
|
131
|
-
if (ffmpeg_ver := os.environ.get("TORIO_USE_FFMPEG_VERSION")) is not None:
|
|
132
|
-
if ffmpeg_ver not in ffmpeg_vers:
|
|
133
|
-
raise ValueError(
|
|
134
|
-
f"The FFmpeg version '{ffmpeg_ver}' (read from TORIO_USE_FFMPEG_VERSION) "
|
|
135
|
-
f"is not one of supported values. Possible values are {ffmpeg_vers}"
|
|
136
|
-
)
|
|
137
|
-
ffmpeg_vers = [ffmpeg_ver]
|
|
138
|
-
return ffmpeg_vers
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
def _init_ffmpeg():
|
|
142
|
-
ffmpeg_vers = _get_ffmpeg_versions()
|
|
143
|
-
ext = _find_ffmpeg_extension(ffmpeg_vers)
|
|
144
|
-
ext.init()
|
|
145
|
-
if ext.get_log_level() > 8:
|
|
146
|
-
ext.set_log_level(8)
|
|
147
|
-
return ext
|