torchaudio 2.7.1__cp313-cp313t-win_amd64.whl → 2.9.0__cp313-cp313t-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.

Files changed (92) hide show
  1. torchaudio/__init__.py +184 -33
  2. torchaudio/_extension/__init__.py +1 -14
  3. torchaudio/_extension/utils.py +0 -47
  4. torchaudio/_internal/module_utils.py +68 -10
  5. torchaudio/_torchcodec.py +340 -0
  6. torchaudio/datasets/cmuarctic.py +1 -1
  7. torchaudio/datasets/utils.py +1 -1
  8. torchaudio/functional/__init__.py +6 -3
  9. torchaudio/functional/_alignment.py +1 -1
  10. torchaudio/functional/filtering.py +70 -55
  11. torchaudio/functional/functional.py +31 -61
  12. torchaudio/lib/_torchaudio.pyd +0 -0
  13. torchaudio/lib/libtorchaudio.pyd +0 -0
  14. torchaudio/models/decoder/__init__.py +19 -1
  15. torchaudio/models/decoder/_ctc_decoder.py +6 -6
  16. torchaudio/models/decoder/_cuda_ctc_decoder.py +1 -1
  17. torchaudio/models/squim/objective.py +2 -2
  18. torchaudio/pipelines/_source_separation_pipeline.py +1 -1
  19. torchaudio/pipelines/_squim_pipeline.py +2 -2
  20. torchaudio/pipelines/_tts/utils.py +3 -1
  21. torchaudio/pipelines/rnnt_pipeline.py +4 -4
  22. torchaudio/transforms/__init__.py +4 -1
  23. torchaudio/transforms/_transforms.py +4 -3
  24. torchaudio/utils/__init__.py +2 -9
  25. torchaudio/utils/download.py +1 -1
  26. torchaudio/version.py +2 -2
  27. {torchaudio-2.7.1.dist-info → torchaudio-2.9.0.dist-info}/METADATA +15 -7
  28. torchaudio-2.9.0.dist-info/RECORD +85 -0
  29. {torchaudio-2.7.1.dist-info → torchaudio-2.9.0.dist-info}/top_level.txt +0 -1
  30. torchaudio/_backend/__init__.py +0 -61
  31. torchaudio/_backend/backend.py +0 -53
  32. torchaudio/_backend/common.py +0 -52
  33. torchaudio/_backend/ffmpeg.py +0 -334
  34. torchaudio/_backend/soundfile.py +0 -54
  35. torchaudio/_backend/soundfile_backend.py +0 -457
  36. torchaudio/_backend/sox.py +0 -91
  37. torchaudio/_backend/utils.py +0 -317
  38. torchaudio/backend/__init__.py +0 -8
  39. torchaudio/backend/_no_backend.py +0 -25
  40. torchaudio/backend/_sox_io_backend.py +0 -294
  41. torchaudio/backend/common.py +0 -13
  42. torchaudio/backend/no_backend.py +0 -14
  43. torchaudio/backend/soundfile_backend.py +0 -14
  44. torchaudio/backend/sox_io_backend.py +0 -14
  45. torchaudio/io/__init__.py +0 -13
  46. torchaudio/io/_effector.py +0 -347
  47. torchaudio/io/_playback.py +0 -72
  48. torchaudio/kaldi_io.py +0 -144
  49. torchaudio/prototype/__init__.py +0 -0
  50. torchaudio/prototype/datasets/__init__.py +0 -4
  51. torchaudio/prototype/datasets/musan.py +0 -67
  52. torchaudio/prototype/functional/__init__.py +0 -26
  53. torchaudio/prototype/functional/_dsp.py +0 -433
  54. torchaudio/prototype/functional/_rir.py +0 -379
  55. torchaudio/prototype/functional/functional.py +0 -190
  56. torchaudio/prototype/models/__init__.py +0 -36
  57. torchaudio/prototype/models/_conformer_wav2vec2.py +0 -794
  58. torchaudio/prototype/models/_emformer_hubert.py +0 -333
  59. torchaudio/prototype/models/conv_emformer.py +0 -525
  60. torchaudio/prototype/models/hifi_gan.py +0 -336
  61. torchaudio/prototype/models/rnnt.py +0 -711
  62. torchaudio/prototype/models/rnnt_decoder.py +0 -399
  63. torchaudio/prototype/pipelines/__init__.py +0 -12
  64. torchaudio/prototype/pipelines/_vggish/__init__.py +0 -3
  65. torchaudio/prototype/pipelines/_vggish/_vggish_impl.py +0 -233
  66. torchaudio/prototype/pipelines/_vggish/_vggish_pipeline.py +0 -82
  67. torchaudio/prototype/pipelines/hifigan_pipeline.py +0 -228
  68. torchaudio/prototype/pipelines/rnnt_pipeline.py +0 -58
  69. torchaudio/prototype/transforms/__init__.py +0 -9
  70. torchaudio/prototype/transforms/_transforms.py +0 -456
  71. torchaudio/sox_effects/__init__.py +0 -10
  72. torchaudio/sox_effects/sox_effects.py +0 -272
  73. torchaudio/utils/ffmpeg_utils.py +0 -11
  74. torchaudio/utils/sox_utils.py +0 -99
  75. torchaudio-2.7.1.dist-info/RECORD +0 -144
  76. torio/__init__.py +0 -8
  77. torio/_extension/__init__.py +0 -13
  78. torio/_extension/utils.py +0 -147
  79. torio/io/__init__.py +0 -9
  80. torio/io/_streaming_media_decoder.py +0 -978
  81. torio/io/_streaming_media_encoder.py +0 -502
  82. torio/lib/__init__.py +0 -0
  83. torio/lib/_torio_ffmpeg4.pyd +0 -0
  84. torio/lib/_torio_ffmpeg5.pyd +0 -0
  85. torio/lib/_torio_ffmpeg6.pyd +0 -0
  86. torio/lib/libtorio_ffmpeg4.pyd +0 -0
  87. torio/lib/libtorio_ffmpeg5.pyd +0 -0
  88. torio/lib/libtorio_ffmpeg6.pyd +0 -0
  89. torio/utils/__init__.py +0 -4
  90. torio/utils/ffmpeg_utils.py +0 -247
  91. {torchaudio-2.7.1.dist-info → torchaudio-2.9.0.dist-info}/LICENSE +0 -0
  92. {torchaudio-2.7.1.dist-info → torchaudio-2.9.0.dist-info}/WHEEL +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
torio/io/__init__.py DELETED
@@ -1,9 +0,0 @@
1
- from ._streaming_media_decoder import StreamingMediaDecoder
2
- from ._streaming_media_encoder import CodecConfig, StreamingMediaEncoder
3
-
4
-
5
- __all__ = [
6
- "StreamingMediaDecoder",
7
- "CodecConfig",
8
- "StreamingMediaEncoder",
9
- ]