analyzeAudio 0.0.14__tar.gz → 0.0.15__tar.gz
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-0.0.14 → analyzeaudio-0.0.15}/PKG-INFO +40 -18
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/README.md +36 -14
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio/analyzersUseFilename.py +17 -17
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio/audioAspectsRegistry.py +9 -8
- analyzeaudio-0.0.15/analyzeAudio/py.typed +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio.egg-info/PKG-INFO +40 -18
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio.egg-info/SOURCES.txt +1 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/pyproject.toml +6 -6
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/LICENSE +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio/__init__.py +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio/analyzersUseSpectrogram.py +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio/analyzersUseTensor.py +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio/analyzersUseWaveform.py +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio/pythonator.py +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio.egg-info/dependency_links.txt +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio.egg-info/entry_points.txt +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio.egg-info/requires.txt +1 -1
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/analyzeAudio.egg-info/top_level.txt +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/setup.cfg +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/tests/conftest.py +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/tests/test_audioAspectsRegistry.py +0 -0
- {analyzeaudio-0.0.14 → analyzeaudio-0.0.15}/tests/test_other.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: analyzeAudio
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.15
|
|
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
|
|
@@ -15,7 +15,6 @@ Classifier: Intended Audience :: End Users/Desktop
|
|
|
15
15
|
Classifier: Intended Audience :: Science/Research
|
|
16
16
|
Classifier: Intended Audience :: Information Technology
|
|
17
17
|
Classifier: Intended Audience :: Other Audience
|
|
18
|
-
Classifier: License :: Free for non-commercial use
|
|
19
18
|
Classifier: Natural Language :: English
|
|
20
19
|
Classifier: Operating System :: OS Independent
|
|
21
20
|
Classifier: Programming Language :: Python
|
|
@@ -44,10 +43,11 @@ Requires-Dist: torchmetrics[audio]
|
|
|
44
43
|
Requires-Dist: tqdm
|
|
45
44
|
Requires-Dist: Z0Z_tools
|
|
46
45
|
Provides-Extra: testing
|
|
46
|
+
Requires-Dist: pytest; extra == "testing"
|
|
47
47
|
Requires-Dist: pytest-cov; extra == "testing"
|
|
48
48
|
Requires-Dist: pytest-xdist; extra == "testing"
|
|
49
|
-
Requires-Dist: pytest; extra == "testing"
|
|
50
49
|
Requires-Dist: pyupgrade; extra == "testing"
|
|
50
|
+
Dynamic: license-file
|
|
51
51
|
|
|
52
52
|
# analyzeAudio
|
|
53
53
|
|
|
@@ -139,12 +139,45 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
139
139
|
'Signal entropy': float
|
|
140
140
|
'Spectral Bandwidth': NDArray[float64] # shape(..., 1, frames)
|
|
141
141
|
'Spectral Bandwidth mean': float
|
|
142
|
-
'Spectral centroid': NDArray[float64] # shape(channels, frames)
|
|
143
|
-
'Spectral centroid mean': float
|
|
144
142
|
'Spectral Centroid': NDArray[float64] # shape(..., 1, frames)
|
|
145
143
|
'Spectral Centroid mean': float
|
|
146
144
|
'Spectral Contrast': NDArray[float64] # shape(..., 7, frames)
|
|
147
145
|
'Spectral Contrast mean': float
|
|
146
|
+
'Spectral Flatness': NDArray[float64] # shape(..., 1, frames)
|
|
147
|
+
'Spectral Flatness mean': float
|
|
148
|
+
'SRMR': NDArray[float64] # shape(...)
|
|
149
|
+
'SRMR mean': float
|
|
150
|
+
'Tempo': NDArray[float64] # shape(...)
|
|
151
|
+
'Tempo mean': float
|
|
152
|
+
'Tempogram': NDArray[float64] # shape(..., 384, samples)
|
|
153
|
+
'Tempogram mean': float
|
|
154
|
+
'Zero-crossing rate': NDArray[float64] # shape(..., 1, frames)
|
|
155
|
+
'Zero-crossing rate mean': float
|
|
156
|
+
'Zero-crossings rate': float
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### I had to revert back to these
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
'Spectral centroid': float
|
|
163
|
+
'Spectral crest': float
|
|
164
|
+
'Spectral decrease': float
|
|
165
|
+
'Spectral entropy': float
|
|
166
|
+
'Spectral flatness': float
|
|
167
|
+
'Spectral flux': float
|
|
168
|
+
'Spectral kurtosis': float
|
|
169
|
+
'Spectral rolloff': float
|
|
170
|
+
'Spectral skewness': float
|
|
171
|
+
'Spectral slope': float
|
|
172
|
+
'Spectral spread': float
|
|
173
|
+
'Spectral variance': float
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Removed (temporarily, I hope)
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
'Spectral centroid': NDArray[float64] # shape(channels, frames)
|
|
180
|
+
'Spectral centroid mean': float
|
|
148
181
|
'Spectral crest': NDArray[float64] # shape(channels, frames)
|
|
149
182
|
'Spectral crest mean': float
|
|
150
183
|
'Spectral decrease': NDArray[float64] # shape(channels, frames)
|
|
@@ -153,8 +186,6 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
153
186
|
'Spectral entropy mean': float
|
|
154
187
|
'Spectral flatness': NDArray[float64] # shape(channels, frames)
|
|
155
188
|
'Spectral flatness mean': float
|
|
156
|
-
'Spectral Flatness': NDArray[float64] # shape(..., 1, frames)
|
|
157
|
-
'Spectral Flatness mean': float
|
|
158
189
|
'Spectral flux': NDArray[float64] # shape(channels, frames)
|
|
159
190
|
'Spectral flux mean': float
|
|
160
191
|
'Spectral kurtosis': NDArray[float64] # shape(channels, frames)
|
|
@@ -169,15 +200,6 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
169
200
|
'Spectral spread mean': float
|
|
170
201
|
'Spectral variance': NDArray[float64] # shape(channels, frames)
|
|
171
202
|
'Spectral variance mean': float
|
|
172
|
-
'SRMR': NDArray[float64] # shape(...)
|
|
173
|
-
'SRMR mean': float
|
|
174
|
-
'Tempo': NDArray[float64] # shape(...)
|
|
175
|
-
'Tempo mean': float
|
|
176
|
-
'Tempogram': NDArray[float64] # shape(..., 384, samples)
|
|
177
|
-
'Tempogram mean': float
|
|
178
|
-
'Zero-crossing rate': NDArray[float64] # shape(..., 1, frames)
|
|
179
|
-
'Zero-crossing rate mean': float
|
|
180
|
-
'Zero-crossings rate': float
|
|
181
203
|
```
|
|
182
204
|
|
|
183
205
|
## Installation
|
|
@@ -191,4 +213,4 @@ pip install analyzeAudio
|
|
|
191
213
|
[](https://HunterThinks.com/support)
|
|
192
214
|
[](https://www.youtube.com/@HunterHogan)
|
|
193
215
|
|
|
194
|
-
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
|
@@ -88,12 +88,45 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
88
88
|
'Signal entropy': float
|
|
89
89
|
'Spectral Bandwidth': NDArray[float64] # shape(..., 1, frames)
|
|
90
90
|
'Spectral Bandwidth mean': float
|
|
91
|
-
'Spectral centroid': NDArray[float64] # shape(channels, frames)
|
|
92
|
-
'Spectral centroid mean': float
|
|
93
91
|
'Spectral Centroid': NDArray[float64] # shape(..., 1, frames)
|
|
94
92
|
'Spectral Centroid mean': float
|
|
95
93
|
'Spectral Contrast': NDArray[float64] # shape(..., 7, frames)
|
|
96
94
|
'Spectral Contrast mean': float
|
|
95
|
+
'Spectral Flatness': NDArray[float64] # shape(..., 1, frames)
|
|
96
|
+
'Spectral Flatness mean': float
|
|
97
|
+
'SRMR': NDArray[float64] # shape(...)
|
|
98
|
+
'SRMR mean': float
|
|
99
|
+
'Tempo': NDArray[float64] # shape(...)
|
|
100
|
+
'Tempo mean': float
|
|
101
|
+
'Tempogram': NDArray[float64] # shape(..., 384, samples)
|
|
102
|
+
'Tempogram mean': float
|
|
103
|
+
'Zero-crossing rate': NDArray[float64] # shape(..., 1, frames)
|
|
104
|
+
'Zero-crossing rate mean': float
|
|
105
|
+
'Zero-crossings rate': float
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### I had to revert back to these
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
'Spectral centroid': float
|
|
112
|
+
'Spectral crest': float
|
|
113
|
+
'Spectral decrease': float
|
|
114
|
+
'Spectral entropy': float
|
|
115
|
+
'Spectral flatness': float
|
|
116
|
+
'Spectral flux': float
|
|
117
|
+
'Spectral kurtosis': float
|
|
118
|
+
'Spectral rolloff': float
|
|
119
|
+
'Spectral skewness': float
|
|
120
|
+
'Spectral slope': float
|
|
121
|
+
'Spectral spread': float
|
|
122
|
+
'Spectral variance': float
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Removed (temporarily, I hope)
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
'Spectral centroid': NDArray[float64] # shape(channels, frames)
|
|
129
|
+
'Spectral centroid mean': float
|
|
97
130
|
'Spectral crest': NDArray[float64] # shape(channels, frames)
|
|
98
131
|
'Spectral crest mean': float
|
|
99
132
|
'Spectral decrease': NDArray[float64] # shape(channels, frames)
|
|
@@ -102,8 +135,6 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
102
135
|
'Spectral entropy mean': float
|
|
103
136
|
'Spectral flatness': NDArray[float64] # shape(channels, frames)
|
|
104
137
|
'Spectral flatness mean': float
|
|
105
|
-
'Spectral Flatness': NDArray[float64] # shape(..., 1, frames)
|
|
106
|
-
'Spectral Flatness mean': float
|
|
107
138
|
'Spectral flux': NDArray[float64] # shape(channels, frames)
|
|
108
139
|
'Spectral flux mean': float
|
|
109
140
|
'Spectral kurtosis': NDArray[float64] # shape(channels, frames)
|
|
@@ -118,15 +149,6 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
118
149
|
'Spectral spread mean': float
|
|
119
150
|
'Spectral variance': NDArray[float64] # shape(channels, frames)
|
|
120
151
|
'Spectral variance mean': float
|
|
121
|
-
'SRMR': NDArray[float64] # shape(...)
|
|
122
|
-
'SRMR mean': float
|
|
123
|
-
'Tempo': NDArray[float64] # shape(...)
|
|
124
|
-
'Tempo mean': float
|
|
125
|
-
'Tempogram': NDArray[float64] # shape(..., 384, samples)
|
|
126
|
-
'Tempogram mean': float
|
|
127
|
-
'Zero-crossing rate': NDArray[float64] # shape(..., 1, frames)
|
|
128
|
-
'Zero-crossing rate mean': float
|
|
129
|
-
'Zero-crossings rate': float
|
|
130
152
|
```
|
|
131
153
|
|
|
132
154
|
## Installation
|
|
@@ -140,4 +162,4 @@ pip install analyzeAudio
|
|
|
140
162
|
[](https://HunterThinks.com/support)
|
|
141
163
|
[](https://www.youtube.com/@HunterHogan)
|
|
142
164
|
|
|
143
|
-
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
|
@@ -40,7 +40,7 @@ def getSI_SDRmean(pathFilenameAlpha: str | PathLike[Any], pathFilenameBeta: str
|
|
|
40
40
|
return SI_SDRmean
|
|
41
41
|
|
|
42
42
|
@cachetools.cached(cache=cacheAudioAnalyzers)
|
|
43
|
-
def ffprobeShotgunAndCache(pathFilename: str | PathLike[Any]) -> dict[str, float
|
|
43
|
+
def ffprobeShotgunAndCache(pathFilename: str | PathLike[Any]) -> dict[str, float]:
|
|
44
44
|
# for lavfi amovie/movie, the colons after driveLetter letters need to be escaped twice.
|
|
45
45
|
pFn = pathlib.PureWindowsPath(pathFilename)
|
|
46
46
|
lavfiPathFilename = pFn.drive.replace(":", "\\\\:")+pathlib.PureWindowsPath(pFn.root,pFn.relative_to(pFn.anchor)).as_posix()
|
|
@@ -63,14 +63,14 @@ def ffprobeShotgunAndCache(pathFilename: str | PathLike[Any]) -> dict[str, float
|
|
|
63
63
|
stdoutFFprobe, _DISCARDstderr = systemProcessFFprobe.communicate()
|
|
64
64
|
FFprobeStructured = pythonizeFFprobe(stdoutFFprobe.decode('utf-8'))[-1]
|
|
65
65
|
|
|
66
|
-
dictionaryAspectsAnalyzed: dict[str, float
|
|
66
|
+
dictionaryAspectsAnalyzed: dict[str, float] = {}
|
|
67
67
|
if 'aspectralstats' in FFprobeStructured:
|
|
68
68
|
for keyName in FFprobeStructured['aspectralstats']:
|
|
69
69
|
# No matter how many channels, each keyName is `numpy.ndarray[tuple[int, int], numpy.dtype[numpy.float64]]`
|
|
70
70
|
# where `tuple[int, int]` is (channel, frame)
|
|
71
71
|
# NOTE (as of this writing) `registrar` can only understand the generic class `numpy.ndarray` and not more specific typing
|
|
72
|
-
dictionaryAspectsAnalyzed[keyName] = FFprobeStructured['aspectralstats'][keyName]
|
|
73
|
-
|
|
72
|
+
# dictionaryAspectsAnalyzed[keyName] = FFprobeStructured['aspectralstats'][keyName]
|
|
73
|
+
dictionaryAspectsAnalyzed[keyName] = numpy.mean(FFprobeStructured['aspectralstats'][keyName]).astype(float)
|
|
74
74
|
if 'r128' in FFprobeStructured:
|
|
75
75
|
for keyName in FFprobeStructured['r128']:
|
|
76
76
|
dictionaryAspectsAnalyzed[keyName] = FFprobeStructured['r128'][keyName][-1]
|
|
@@ -133,55 +133,55 @@ def analyzeLUFShigh(pathFilename: str | PathLike[Any]) -> float | None:
|
|
|
133
133
|
return ffprobeShotgunAndCache(pathFilename).get('LRA.high')
|
|
134
134
|
|
|
135
135
|
@registrationAudioAspect('Power spectral density')
|
|
136
|
-
def analyzeMean(pathFilename: str | PathLike[Any]) ->
|
|
136
|
+
def analyzeMean(pathFilename: str | PathLike[Any]) -> float | None:
|
|
137
137
|
return ffprobeShotgunAndCache(pathFilename).get('mean')
|
|
138
138
|
|
|
139
139
|
@registrationAudioAspect('Spectral variance')
|
|
140
|
-
def analyzeVariance(pathFilename: str | PathLike[Any]) ->
|
|
140
|
+
def analyzeVariance(pathFilename: str | PathLike[Any]) -> float | None:
|
|
141
141
|
return ffprobeShotgunAndCache(pathFilename).get('variance')
|
|
142
142
|
|
|
143
143
|
@registrationAudioAspect('Spectral centroid')
|
|
144
|
-
def analyzeCentroid(pathFilename: str | PathLike[Any]) ->
|
|
144
|
+
def analyzeCentroid(pathFilename: str | PathLike[Any]) -> float | None:
|
|
145
145
|
return ffprobeShotgunAndCache(pathFilename).get('centroid')
|
|
146
146
|
|
|
147
147
|
@registrationAudioAspect('Spectral spread')
|
|
148
|
-
def analyzeSpread(pathFilename: str | PathLike[Any]) ->
|
|
148
|
+
def analyzeSpread(pathFilename: str | PathLike[Any]) -> float | None:
|
|
149
149
|
return ffprobeShotgunAndCache(pathFilename).get('spread')
|
|
150
150
|
|
|
151
151
|
@registrationAudioAspect('Spectral skewness')
|
|
152
|
-
def analyzeSkewness(pathFilename: str | PathLike[Any]) ->
|
|
152
|
+
def analyzeSkewness(pathFilename: str | PathLike[Any]) -> float | None:
|
|
153
153
|
return ffprobeShotgunAndCache(pathFilename).get('skewness')
|
|
154
154
|
|
|
155
155
|
@registrationAudioAspect('Spectral kurtosis')
|
|
156
|
-
def analyzeKurtosis(pathFilename: str | PathLike[Any]) ->
|
|
156
|
+
def analyzeKurtosis(pathFilename: str | PathLike[Any]) -> float | None:
|
|
157
157
|
return ffprobeShotgunAndCache(pathFilename).get('kurtosis')
|
|
158
158
|
|
|
159
159
|
@registrationAudioAspect('Spectral entropy')
|
|
160
|
-
def analyzeSpectralEntropy(pathFilename: str | PathLike[Any]) ->
|
|
160
|
+
def analyzeSpectralEntropy(pathFilename: str | PathLike[Any]) -> float | None:
|
|
161
161
|
return ffprobeShotgunAndCache(pathFilename).get('entropy')
|
|
162
162
|
|
|
163
163
|
@registrationAudioAspect('Spectral flatness')
|
|
164
|
-
def analyzeFlatness(pathFilename: str | PathLike[Any]) ->
|
|
164
|
+
def analyzeFlatness(pathFilename: str | PathLike[Any]) -> float | None:
|
|
165
165
|
return ffprobeShotgunAndCache(pathFilename).get('flatness')
|
|
166
166
|
|
|
167
167
|
@registrationAudioAspect('Spectral crest')
|
|
168
|
-
def analyzeCrest(pathFilename: str | PathLike[Any]) ->
|
|
168
|
+
def analyzeCrest(pathFilename: str | PathLike[Any]) -> float | None:
|
|
169
169
|
return ffprobeShotgunAndCache(pathFilename).get('crest')
|
|
170
170
|
|
|
171
171
|
@registrationAudioAspect('Spectral flux')
|
|
172
|
-
def analyzeFlux(pathFilename: str | PathLike[Any]) ->
|
|
172
|
+
def analyzeFlux(pathFilename: str | PathLike[Any]) -> float | None:
|
|
173
173
|
return ffprobeShotgunAndCache(pathFilename).get('flux')
|
|
174
174
|
|
|
175
175
|
@registrationAudioAspect('Spectral slope')
|
|
176
|
-
def analyzeSlope(pathFilename: str | PathLike[Any]) ->
|
|
176
|
+
def analyzeSlope(pathFilename: str | PathLike[Any]) -> float | None:
|
|
177
177
|
return ffprobeShotgunAndCache(pathFilename).get('slope')
|
|
178
178
|
|
|
179
179
|
@registrationAudioAspect('Spectral decrease')
|
|
180
|
-
def analyzeDecrease(pathFilename: str | PathLike[Any]) ->
|
|
180
|
+
def analyzeDecrease(pathFilename: str | PathLike[Any]) -> float | None:
|
|
181
181
|
return ffprobeShotgunAndCache(pathFilename).get('decrease')
|
|
182
182
|
|
|
183
183
|
@registrationAudioAspect('Spectral rolloff')
|
|
184
|
-
def analyzeRolloff(pathFilename: str | PathLike[Any]) ->
|
|
184
|
+
def analyzeRolloff(pathFilename: str | PathLike[Any]) -> float | None:
|
|
185
185
|
return ffprobeShotgunAndCache(pathFilename).get('rolloff')
|
|
186
186
|
|
|
187
187
|
@registrationAudioAspect('Abs_Peak_count')
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
from collections.abc import Callable, Sequence
|
|
2
2
|
from concurrent.futures import ProcessPoolExecutor, as_completed
|
|
3
3
|
from numpy.typing import NDArray
|
|
4
|
+
from os import PathLike
|
|
4
5
|
from typing import Any, cast, ParamSpec, TypeAlias, TYPE_CHECKING, TypeVar
|
|
5
6
|
from Z0Z_tools import defineConcurrencyLimit, oopsieKwargsie, stft
|
|
6
7
|
import cachetools
|
|
7
8
|
import inspect
|
|
8
|
-
import librosa
|
|
9
|
-
import multiprocessing
|
|
10
9
|
import numpy
|
|
11
|
-
from os import PathLike
|
|
12
10
|
import pathlib
|
|
13
11
|
import soundfile
|
|
14
12
|
import torch
|
|
@@ -19,8 +17,11 @@ if TYPE_CHECKING:
|
|
|
19
17
|
else:
|
|
20
18
|
TypedDict = dict
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
from multiprocessing import set_start_method as multiprocessing_set_start_method
|
|
21
|
+
try:
|
|
22
|
+
multiprocessing_set_start_method('spawn')
|
|
23
|
+
except RuntimeError:
|
|
24
|
+
pass
|
|
24
25
|
|
|
25
26
|
warnings.filterwarnings('ignore', category=UserWarning, module='torchmetrics', message='.*fast=True.*')
|
|
26
27
|
|
|
@@ -112,9 +113,9 @@ def analyzeAudioFile(pathFilename: str | PathLike[Any], listAspectNames: list[st
|
|
|
112
113
|
else:
|
|
113
114
|
raise ERRORmessage
|
|
114
115
|
|
|
115
|
-
spectrogram = stft(waveform, sampleRate=sampleRate)
|
|
116
|
-
spectrogramMagnitude = numpy.absolute(spectrogram)
|
|
117
|
-
spectrogramPower = spectrogramMagnitude ** 2
|
|
116
|
+
# spectrogram = stft(waveform, sampleRate=sampleRate)
|
|
117
|
+
# spectrogramMagnitude = numpy.absolute(spectrogram)
|
|
118
|
+
# spectrogramPower = spectrogramMagnitude ** 2
|
|
118
119
|
|
|
119
120
|
pytorchOnCPU = not torch.cuda.is_available() # False if GPU available, True if not
|
|
120
121
|
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: analyzeAudio
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.15
|
|
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
|
|
@@ -15,7 +15,6 @@ Classifier: Intended Audience :: End Users/Desktop
|
|
|
15
15
|
Classifier: Intended Audience :: Science/Research
|
|
16
16
|
Classifier: Intended Audience :: Information Technology
|
|
17
17
|
Classifier: Intended Audience :: Other Audience
|
|
18
|
-
Classifier: License :: Free for non-commercial use
|
|
19
18
|
Classifier: Natural Language :: English
|
|
20
19
|
Classifier: Operating System :: OS Independent
|
|
21
20
|
Classifier: Programming Language :: Python
|
|
@@ -44,10 +43,11 @@ Requires-Dist: torchmetrics[audio]
|
|
|
44
43
|
Requires-Dist: tqdm
|
|
45
44
|
Requires-Dist: Z0Z_tools
|
|
46
45
|
Provides-Extra: testing
|
|
46
|
+
Requires-Dist: pytest; extra == "testing"
|
|
47
47
|
Requires-Dist: pytest-cov; extra == "testing"
|
|
48
48
|
Requires-Dist: pytest-xdist; extra == "testing"
|
|
49
|
-
Requires-Dist: pytest; extra == "testing"
|
|
50
49
|
Requires-Dist: pyupgrade; extra == "testing"
|
|
50
|
+
Dynamic: license-file
|
|
51
51
|
|
|
52
52
|
# analyzeAudio
|
|
53
53
|
|
|
@@ -139,12 +139,45 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
139
139
|
'Signal entropy': float
|
|
140
140
|
'Spectral Bandwidth': NDArray[float64] # shape(..., 1, frames)
|
|
141
141
|
'Spectral Bandwidth mean': float
|
|
142
|
-
'Spectral centroid': NDArray[float64] # shape(channels, frames)
|
|
143
|
-
'Spectral centroid mean': float
|
|
144
142
|
'Spectral Centroid': NDArray[float64] # shape(..., 1, frames)
|
|
145
143
|
'Spectral Centroid mean': float
|
|
146
144
|
'Spectral Contrast': NDArray[float64] # shape(..., 7, frames)
|
|
147
145
|
'Spectral Contrast mean': float
|
|
146
|
+
'Spectral Flatness': NDArray[float64] # shape(..., 1, frames)
|
|
147
|
+
'Spectral Flatness mean': float
|
|
148
|
+
'SRMR': NDArray[float64] # shape(...)
|
|
149
|
+
'SRMR mean': float
|
|
150
|
+
'Tempo': NDArray[float64] # shape(...)
|
|
151
|
+
'Tempo mean': float
|
|
152
|
+
'Tempogram': NDArray[float64] # shape(..., 384, samples)
|
|
153
|
+
'Tempogram mean': float
|
|
154
|
+
'Zero-crossing rate': NDArray[float64] # shape(..., 1, frames)
|
|
155
|
+
'Zero-crossing rate mean': float
|
|
156
|
+
'Zero-crossings rate': float
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### I had to revert back to these
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
'Spectral centroid': float
|
|
163
|
+
'Spectral crest': float
|
|
164
|
+
'Spectral decrease': float
|
|
165
|
+
'Spectral entropy': float
|
|
166
|
+
'Spectral flatness': float
|
|
167
|
+
'Spectral flux': float
|
|
168
|
+
'Spectral kurtosis': float
|
|
169
|
+
'Spectral rolloff': float
|
|
170
|
+
'Spectral skewness': float
|
|
171
|
+
'Spectral slope': float
|
|
172
|
+
'Spectral spread': float
|
|
173
|
+
'Spectral variance': float
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Removed (temporarily, I hope)
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
'Spectral centroid': NDArray[float64] # shape(channels, frames)
|
|
180
|
+
'Spectral centroid mean': float
|
|
148
181
|
'Spectral crest': NDArray[float64] # shape(channels, frames)
|
|
149
182
|
'Spectral crest mean': float
|
|
150
183
|
'Spectral decrease': NDArray[float64] # shape(channels, frames)
|
|
@@ -153,8 +186,6 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
153
186
|
'Spectral entropy mean': float
|
|
154
187
|
'Spectral flatness': NDArray[float64] # shape(channels, frames)
|
|
155
188
|
'Spectral flatness mean': float
|
|
156
|
-
'Spectral Flatness': NDArray[float64] # shape(..., 1, frames)
|
|
157
|
-
'Spectral Flatness mean': float
|
|
158
189
|
'Spectral flux': NDArray[float64] # shape(channels, frames)
|
|
159
190
|
'Spectral flux mean': float
|
|
160
191
|
'Spectral kurtosis': NDArray[float64] # shape(channels, frames)
|
|
@@ -169,15 +200,6 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
169
200
|
'Spectral spread mean': float
|
|
170
201
|
'Spectral variance': NDArray[float64] # shape(channels, frames)
|
|
171
202
|
'Spectral variance mean': float
|
|
172
|
-
'SRMR': NDArray[float64] # shape(...)
|
|
173
|
-
'SRMR mean': float
|
|
174
|
-
'Tempo': NDArray[float64] # shape(...)
|
|
175
|
-
'Tempo mean': float
|
|
176
|
-
'Tempogram': NDArray[float64] # shape(..., 384, samples)
|
|
177
|
-
'Tempogram mean': float
|
|
178
|
-
'Zero-crossing rate': NDArray[float64] # shape(..., 1, frames)
|
|
179
|
-
'Zero-crossing rate mean': float
|
|
180
|
-
'Zero-crossings rate': float
|
|
181
203
|
```
|
|
182
204
|
|
|
183
205
|
## Installation
|
|
@@ -191,4 +213,4 @@ pip install analyzeAudio
|
|
|
191
213
|
[](https://HunterThinks.com/support)
|
|
192
214
|
[](https://www.youtube.com/@HunterHogan)
|
|
193
215
|
|
|
194
|
-
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
|
@@ -7,6 +7,7 @@ analyzeAudio/analyzersUseSpectrogram.py
|
|
|
7
7
|
analyzeAudio/analyzersUseTensor.py
|
|
8
8
|
analyzeAudio/analyzersUseWaveform.py
|
|
9
9
|
analyzeAudio/audioAspectsRegistry.py
|
|
10
|
+
analyzeAudio/py.typed
|
|
10
11
|
analyzeAudio/pythonator.py
|
|
11
12
|
analyzeAudio.egg-info/PKG-INFO
|
|
12
13
|
analyzeAudio.egg-info/SOURCES.txt
|
|
@@ -12,7 +12,6 @@ classifiers = [
|
|
|
12
12
|
"Intended Audience :: Science/Research",
|
|
13
13
|
"Intended Audience :: Information Technology",
|
|
14
14
|
"Intended Audience :: Other Audience",
|
|
15
|
-
"License :: Free for non-commercial use",
|
|
16
15
|
"Natural Language :: English",
|
|
17
16
|
"Operating System :: OS Independent",
|
|
18
17
|
"Programming Language :: Python",
|
|
@@ -43,14 +42,14 @@ keywords = ["audio", "analysis", "measurement", "metrics", "torch", "spectrum",
|
|
|
43
42
|
license = { 'text' = "CC-BY-NC-4.0" }
|
|
44
43
|
name = "analyzeAudio"
|
|
45
44
|
optional-dependencies = { testing = [
|
|
45
|
+
"pytest",
|
|
46
46
|
"pytest-cov",
|
|
47
47
|
"pytest-xdist",
|
|
48
|
-
"pytest",
|
|
49
48
|
"pyupgrade",] }
|
|
50
49
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
51
50
|
requires-python = ">=3.10"
|
|
52
51
|
urls = { Donate = "https://www.patreon.com/integrated", Homepage = "https://github.com/hunterhogan/analyzeAudio", Repository = "https://github.com/hunterhogan/analyzeAudio.git" }
|
|
53
|
-
version = "0.0.
|
|
52
|
+
version = "0.0.15"
|
|
54
53
|
|
|
55
54
|
[project.scripts]
|
|
56
55
|
whatMeasurements = "analyzeAudio.audioAspectsRegistry:getListAvailableAudioAspects"
|
|
@@ -69,12 +68,13 @@ run = { branch = true, concurrency = [
|
|
|
69
68
|
xml = { output = "tests/coverage/coverage.xml" }
|
|
70
69
|
|
|
71
70
|
[tool.pytest.ini_options]
|
|
72
|
-
log_auto_indent =
|
|
71
|
+
log_auto_indent = true
|
|
73
72
|
addopts = ["--color=yes", "-n 4"]
|
|
74
73
|
testpaths = ["tests"]
|
|
75
74
|
|
|
76
|
-
[tool.setuptools
|
|
77
|
-
|
|
75
|
+
[tool.setuptools]
|
|
76
|
+
package-data = { "*" = ["py.typed"] }
|
|
77
|
+
packages = { find = {} }
|
|
78
78
|
|
|
79
79
|
[tool.updateCitation]
|
|
80
80
|
filenameCitationDOTcff = 'CITATION.cff'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|