analyzeAudio 0.0.17__py3-none-any.whl → 0.0.18__py3-none-any.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.
- analyzeAudio/__init__.py +6 -6
- analyzeAudio/analyzersUseFilename.py +1 -1
- analyzeAudio/audioAspectsRegistry.py +4 -5
- analyzeAudio/pythonator.py +2 -2
- {analyzeaudio-0.0.17.dist-info → analyzeaudio-0.0.18.dist-info}/METADATA +7 -15
- analyzeaudio-0.0.18.dist-info/RECORD +17 -0
- {analyzeaudio-0.0.17.dist-info → analyzeaudio-0.0.18.dist-info}/WHEEL +1 -1
- analyzeaudio-0.0.17.dist-info/RECORD +0 -17
- {analyzeaudio-0.0.17.dist-info → analyzeaudio-0.0.18.dist-info}/entry_points.txt +0 -0
- {analyzeaudio-0.0.17.dist-info → analyzeaudio-0.0.18.dist-info}/licenses/LICENSE +0 -0
- {analyzeaudio-0.0.17.dist-info → analyzeaudio-0.0.18.dist-info}/top_level.txt +0 -0
analyzeAudio/__init__.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"""Docstring?! Ain't nobody got time for that!."""
|
|
2
|
+
from .audioAspectsRegistry import (
|
|
3
|
+
analyzeAudioFile, analyzeAudioListPathFilenames, audioAspects, cacheAudioAnalyzers, getListAvailableAudioAspects,
|
|
4
|
+
registrationAudioAspect)
|
|
3
5
|
|
|
4
6
|
__all__ = [
|
|
5
7
|
'analyzeAudioFile',
|
|
@@ -8,7 +10,5 @@ __all__ = [
|
|
|
8
10
|
'getListAvailableAudioAspects',
|
|
9
11
|
]
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
from . import analyzersUseSpectrogram
|
|
13
|
-
from . import analyzersUseTensor
|
|
14
|
-
from . import analyzersUseWaveform
|
|
13
|
+
# isort: split
|
|
14
|
+
from . import analyzersUseFilename, analyzersUseSpectrogram, analyzersUseTensor, analyzersUseWaveform
|
|
@@ -37,7 +37,7 @@ def getSI_SDRmean(pathFilenameAlpha: str | PathLike[Any], pathFilenameBeta: str
|
|
|
37
37
|
"""
|
|
38
38
|
commandLineFFmpeg = [
|
|
39
39
|
'ffmpeg', '-hide_banner', '-loglevel', '32',
|
|
40
|
-
'-i', f'{str(pathlib.Path(pathFilenameAlpha))}', '-i', f'{str(pathlib.Path(pathFilenameBeta))}',
|
|
40
|
+
'-i', f'{str(pathlib.Path(pathFilenameAlpha))}', '-i', f'{str(pathlib.Path(pathFilenameBeta))}',
|
|
41
41
|
'-filter_complex', '[0][1]asisdr', '-f', 'null', '-'
|
|
42
42
|
]
|
|
43
43
|
systemProcessFFmpeg = subprocess.run(commandLineFFmpeg, check=True, stderr=subprocess.PIPE)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from collections.abc import Callable, Sequence # noqa: D100
|
|
2
2
|
from concurrent.futures import as_completed, ProcessPoolExecutor
|
|
3
|
-
from hunterMakesPy import defineConcurrencyLimit, oopsieKwargsie
|
|
3
|
+
from hunterMakesPy.parseParameters import defineConcurrencyLimit, oopsieKwargsie
|
|
4
4
|
from multiprocessing import set_start_method as multiprocessing_set_start_method
|
|
5
5
|
from numpy.typing import NDArray
|
|
6
6
|
from os import PathLike
|
|
@@ -30,7 +30,6 @@ class analyzersAudioAspects(TypedDict): # noqa: D101
|
|
|
30
30
|
analyzer: Callable[..., Any]
|
|
31
31
|
analyzerParameters: list[str]
|
|
32
32
|
|
|
33
|
-
|
|
34
33
|
audioAspects: dict[audioAspect, analyzersAudioAspects] = {}
|
|
35
34
|
"""A register of 1) measurable aspects of audio data, 2) analyzer functions to measure audio aspects, 3) and parameters of analyzer functions."""
|
|
36
35
|
|
|
@@ -75,7 +74,7 @@ def registrationAudioAspect(aspectName: str) -> Callable[[Callable[parameterSpec
|
|
|
75
74
|
|
|
76
75
|
"""
|
|
77
76
|
aspectValue = registrant(*arguments, **keywordArguments)
|
|
78
|
-
return numpy.mean(cast(
|
|
77
|
+
return numpy.mean(cast(NDArray[Any], aspectValue))
|
|
79
78
|
# return aspectValue.mean()
|
|
80
79
|
audioAspects[f"{aspectName} mean"] = {
|
|
81
80
|
'analyzer': registrationAudioAspectMean,
|
|
@@ -117,7 +116,7 @@ def analyzeAudioFile(pathFilename: str | PathLike[Any], listAspectNames: list[st
|
|
|
117
116
|
try:
|
|
118
117
|
tensorAudio = torch.from_numpy(waveform) # pyright: ignore[reportUnknownMemberType] # memory-sharing # noqa: F841
|
|
119
118
|
tryAgain = False
|
|
120
|
-
except RuntimeError as ERRORmessage:
|
|
119
|
+
except RuntimeError as ERRORmessage:
|
|
121
120
|
if 'negative stride' in str(ERRORmessage):
|
|
122
121
|
waveform = waveform.copy() # not memory-sharing
|
|
123
122
|
tryAgain = True
|
|
@@ -138,7 +137,7 @@ def analyzeAudioFile(pathFilename: str | PathLike[Any], listAspectNames: list[st
|
|
|
138
137
|
|
|
139
138
|
return [dictionaryAspectsAnalyzed[aspectName] for aspectName in listAspectNames]
|
|
140
139
|
|
|
141
|
-
def analyzeAudioListPathFilenames(listPathFilenames: Sequence[str] | Sequence[PathLike[Any]], listAspectNames: list[str], CPUlimit: int | float | bool | None = None) -> list[list[str | float | NDArray[Any]]]: # noqa: FBT001
|
|
140
|
+
def analyzeAudioListPathFilenames(listPathFilenames: Sequence[str] | Sequence[PathLike[Any]], listAspectNames: list[str], CPUlimit: int | float | bool | None = None) -> list[list[str | float | NDArray[Any]]]: # noqa: FBT001
|
|
142
141
|
"""
|
|
143
142
|
Analyzes a list of audio files for specified aspects of the individual files and returns the results.
|
|
144
143
|
|
analyzeAudio/pythonator.py
CHANGED
|
@@ -17,7 +17,7 @@ class Blackdetect(NamedTuple): # noqa: D101
|
|
|
17
17
|
black_start: float | None = None
|
|
18
18
|
black_end: float | None = None
|
|
19
19
|
|
|
20
|
-
def pythonizeFFprobe(FFprobeJSON_utf8: str) -> tuple[defaultdict[str, Any] | dict[str, Any], dict[str, numpy.ndarray[Any, Any] | dict[str, numpy.ndarray[Any, Any]]]]:
|
|
20
|
+
def pythonizeFFprobe(FFprobeJSON_utf8: str) -> tuple[defaultdict[str, Any] | dict[str, Any], dict[str, numpy.ndarray[Any, Any] | dict[str, numpy.ndarray[Any, Any]]]]:
|
|
21
21
|
FFroot: dict[str, Any] = json.loads(FFprobeJSON_utf8)
|
|
22
22
|
Z0Z_dictionaries: dict[str, numpy.ndarray[Any, Any] | dict[str, numpy.ndarray[Any, Any]]] = {}
|
|
23
23
|
if 'packets_and_frames' in FFroot: # Divide into 'packets' and 'frames'
|
|
@@ -92,7 +92,7 @@ def pythonizeFFprobe(FFprobeJSON_utf8: str) -> tuple[defaultdict[str, Any] | dic
|
|
|
92
92
|
Z0Z_dictionaries[registrant] = {}
|
|
93
93
|
elif statistic not in Z0Z_dictionaries[registrant]:
|
|
94
94
|
# NOTE (as of this writing) `registrar` can only understand the generic class `numpy.ndarray` and not more specific typing # noqa: ERA001
|
|
95
|
-
valueSherpa = cast(
|
|
95
|
+
valueSherpa = cast(numpy.ndarray, numpy.zeros((channel, len(FFroot['frames'])))) # pyright: ignore[reportMissingTypeArgument, reportUnknownVariableType]
|
|
96
96
|
Z0Z_dictionaries[registrant][statistic] = valueSherpa
|
|
97
97
|
else:
|
|
98
98
|
raise # Re-raise the exception
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: analyzeAudio
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.18
|
|
4
4
|
Summary: Measure one or more aspects of one or more audio files.
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
6
|
License: CC-BY-NC-4.0
|
|
7
7
|
Project-URL: Donate, https://www.patreon.com/integrated
|
|
8
8
|
Project-URL: Homepage, https://github.com/hunterhogan/analyzeAudio
|
|
9
|
-
Project-URL: Issues, https://github.com/hunterhogan/
|
|
9
|
+
Project-URL: Issues, https://github.com/hunterhogan/analyzeAudio/issues
|
|
10
10
|
Project-URL: Repository, https://github.com/hunterhogan/analyzeAudio.git
|
|
11
11
|
Keywords: FFmpeg,FFprobe,LUFS,RMS,SRMR,analysis,audio,audio-analysis,loudness,measurement,metrics,signal-processing,spectral,spectrum,torch,waveform
|
|
12
12
|
Classifier: Development Status :: 3 - Alpha
|
|
@@ -20,17 +20,17 @@ Classifier: Natural Language :: English
|
|
|
20
20
|
Classifier: Operating System :: OS Independent
|
|
21
21
|
Classifier: Programming Language :: Python
|
|
22
22
|
Classifier: Programming Language :: Python :: 3
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
24
23
|
Classifier: Programming Language :: Python :: 3.11
|
|
25
24
|
Classifier: Programming Language :: Python :: 3.12
|
|
26
25
|
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
27
27
|
Classifier: Topic :: Multimedia :: Sound/Audio
|
|
28
28
|
Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
|
|
29
29
|
Classifier: Topic :: Multimedia :: Sound/Audio :: Conversion
|
|
30
30
|
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
31
31
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
32
32
|
Classifier: Typing :: Typed
|
|
33
|
-
Requires-Python: >=3.
|
|
33
|
+
Requires-Python: >=3.11
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
35
|
License-File: LICENSE
|
|
36
36
|
Requires-Dist: Z0Z_tools
|
|
@@ -44,11 +44,12 @@ Requires-Dist: torch
|
|
|
44
44
|
Requires-Dist: torchmetrics[audio]
|
|
45
45
|
Requires-Dist: tqdm
|
|
46
46
|
Requires-Dist: typing_extensions
|
|
47
|
+
Provides-Extra: development
|
|
48
|
+
Requires-Dist: setuptools-scm; extra == "development"
|
|
47
49
|
Provides-Extra: testing
|
|
48
50
|
Requires-Dist: pytest; extra == "testing"
|
|
49
51
|
Requires-Dist: pytest-cov; extra == "testing"
|
|
50
52
|
Requires-Dist: pytest-xdist; extra == "testing"
|
|
51
|
-
Requires-Dist: pyupgrade; extra == "testing"
|
|
52
53
|
Dynamic: license-file
|
|
53
54
|
|
|
54
55
|
# analyzeAudio
|
|
@@ -215,13 +216,4 @@ pip install analyzeAudio
|
|
|
215
216
|
[](https://HunterThinks.com/support)
|
|
216
217
|
[](https://www.youtube.com/@HunterHogan)
|
|
217
218
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
Coding One Step at a Time:
|
|
221
|
-
|
|
222
|
-
0. WRITE CODE.
|
|
223
|
-
1. Don't write stupid code that's hard to revise.
|
|
224
|
-
2. Write good code.
|
|
225
|
-
3. When revising, write better code.
|
|
226
|
-
|
|
227
|
-
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
|
219
|
+
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
analyzeAudio/__init__.py,sha256=Ntu1mCDyP9Mozlu9U7BUvxjJBbOaUQAB289R0i4f2_Y,466
|
|
2
|
+
analyzeAudio/analyzersUseFilename.py,sha256=ekpquHWSfCzR0o3rNVqOZoP8HD-GXDPeVSTiwQPslxo,10878
|
|
3
|
+
analyzeAudio/analyzersUseSpectrogram.py,sha256=k1mNzpzXykBIhE3NeizvSwVdfuKQtE_eIpHAR-Bya-I,2640
|
|
4
|
+
analyzeAudio/analyzersUseTensor.py,sha256=Uqf8haZDCQYjHFb_7Ybpm40_QNlKYyh-N1QifiLOeb4,779
|
|
5
|
+
analyzeAudio/analyzersUseWaveform.py,sha256=wfTkASR_2Uj3KpMI8UYQXWuKG4CqDIbhe9B6UgPrpyU,2282
|
|
6
|
+
analyzeAudio/audioAspectsRegistry.py,sha256=Da9i0jydgU4vBiaJBH4I3XhiqHZHlVUYvP3JvqbNDyU,8630
|
|
7
|
+
analyzeAudio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
analyzeAudio/pythonator.py,sha256=Mg-xuRO4mM3RWK6S-5SxygYoI8nqMhhoJqdtnnzqaLs,6002
|
|
9
|
+
analyzeaudio-0.0.18.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
|
|
10
|
+
tests/conftest.py,sha256=BhZswOjkl_u-qiS4Zy38d2fETdWAtZiigeuXYBK8l0k,397
|
|
11
|
+
tests/test_audioAspectsRegistry.py,sha256=-TWTLMdAn6IFv7ZdFWrBm1KxpLBa3Mz1sCygAwxV6gE,27
|
|
12
|
+
tests/test_other.py,sha256=ozabc_DFX5mAeSw3r01hQ8OEMNvbYdToKivSHoDxmG0,535
|
|
13
|
+
analyzeaudio-0.0.18.dist-info/METADATA,sha256=zEjQ7gy9CeuX3I9Od3Zxtf8jhTaa7dIT2G39ySKynJc,9211
|
|
14
|
+
analyzeaudio-0.0.18.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
15
|
+
analyzeaudio-0.0.18.dist-info/entry_points.txt,sha256=FHgSx7fndtZ6SnQ-nWVXf0NB59exaHQ2DtatTK9KrLg,100
|
|
16
|
+
analyzeaudio-0.0.18.dist-info/top_level.txt,sha256=QV8LQ0r_1LIQuewxDcEzODpykv5qRYG3I70piOUSVRg,19
|
|
17
|
+
analyzeaudio-0.0.18.dist-info/RECORD,,
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
analyzeAudio/__init__.py,sha256=2D5JMeZfLGnwyQvt4Q2-HCsShHulcNXBM_Wu9vZPCiI,437
|
|
2
|
-
analyzeAudio/analyzersUseFilename.py,sha256=NShXm8XMHI1QsgitgrLq0hHjyWKzaOdxvRKlBc2XZec,10894
|
|
3
|
-
analyzeAudio/analyzersUseSpectrogram.py,sha256=k1mNzpzXykBIhE3NeizvSwVdfuKQtE_eIpHAR-Bya-I,2640
|
|
4
|
-
analyzeAudio/analyzersUseTensor.py,sha256=Uqf8haZDCQYjHFb_7Ybpm40_QNlKYyh-N1QifiLOeb4,779
|
|
5
|
-
analyzeAudio/analyzersUseWaveform.py,sha256=wfTkASR_2Uj3KpMI8UYQXWuKG4CqDIbhe9B6UgPrpyU,2282
|
|
6
|
-
analyzeAudio/audioAspectsRegistry.py,sha256=hvAAqS4FvJuNnLqBL0Hd813iF87HQ-TfZUdyWLqSA_A,8642
|
|
7
|
-
analyzeAudio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
analyzeAudio/pythonator.py,sha256=fy8uduDQexYJMUQX0uNZHwPEX5sDH_3600W9hvPjZuo,6036
|
|
9
|
-
analyzeaudio-0.0.17.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
|
|
10
|
-
tests/conftest.py,sha256=BhZswOjkl_u-qiS4Zy38d2fETdWAtZiigeuXYBK8l0k,397
|
|
11
|
-
tests/test_audioAspectsRegistry.py,sha256=-TWTLMdAn6IFv7ZdFWrBm1KxpLBa3Mz1sCygAwxV6gE,27
|
|
12
|
-
tests/test_other.py,sha256=ozabc_DFX5mAeSw3r01hQ8OEMNvbYdToKivSHoDxmG0,535
|
|
13
|
-
analyzeaudio-0.0.17.dist-info/METADATA,sha256=DAMobI3GMlYhlHefL2IpN1gu1CNVnx9TT_8xKNwT_Q0,9293
|
|
14
|
-
analyzeaudio-0.0.17.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
-
analyzeaudio-0.0.17.dist-info/entry_points.txt,sha256=FHgSx7fndtZ6SnQ-nWVXf0NB59exaHQ2DtatTK9KrLg,100
|
|
16
|
-
analyzeaudio-0.0.17.dist-info/top_level.txt,sha256=QV8LQ0r_1LIQuewxDcEzODpykv5qRYG3I70piOUSVRg,19
|
|
17
|
-
analyzeaudio-0.0.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|