analyzeAudio 0.0.14__py3-none-any.whl → 0.0.16__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/analyzersUseFilename.py +19 -18
- analyzeAudio/analyzersUseSpectrogram.py +11 -11
- analyzeAudio/analyzersUseTensor.py +3 -2
- analyzeAudio/analyzersUseWaveform.py +9 -9
- analyzeAudio/audioAspectsRegistry.py +8 -7
- analyzeAudio/py.typed +0 -0
- analyzeAudio/pythonator.py +2 -1
- {analyzeaudio-0.0.14.dist-info → analyzeaudio-0.0.16.dist-info}/METADATA +49 -19
- analyzeaudio-0.0.16.dist-info/RECORD +17 -0
- {analyzeaudio-0.0.14.dist-info → analyzeaudio-0.0.16.dist-info}/WHEEL +1 -1
- analyzeaudio-0.0.14.dist-info/RECORD +0 -16
- {analyzeaudio-0.0.14.dist-info → analyzeaudio-0.0.16.dist-info}/entry_points.txt +0 -0
- {analyzeaudio-0.0.14.dist-info → analyzeaudio-0.0.16.dist-info/licenses}/LICENSE +0 -0
- {analyzeaudio-0.0.14.dist-info → analyzeaudio-0.0.16.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"""Analyzers that use the filename of an audio file to analyze its audio data."""
|
|
2
|
+
from analyzeAudio.pythonator import pythonizeFFprobe
|
|
2
3
|
from analyzeAudio import registrationAudioAspect, cacheAudioAnalyzers
|
|
3
4
|
from os import PathLike
|
|
4
5
|
from statistics import mean
|
|
@@ -40,7 +41,7 @@ def getSI_SDRmean(pathFilenameAlpha: str | PathLike[Any], pathFilenameBeta: str
|
|
|
40
41
|
return SI_SDRmean
|
|
41
42
|
|
|
42
43
|
@cachetools.cached(cache=cacheAudioAnalyzers)
|
|
43
|
-
def ffprobeShotgunAndCache(pathFilename: str | PathLike[Any]) -> dict[str, float
|
|
44
|
+
def ffprobeShotgunAndCache(pathFilename: str | PathLike[Any]) -> dict[str, float]:
|
|
44
45
|
# for lavfi amovie/movie, the colons after driveLetter letters need to be escaped twice.
|
|
45
46
|
pFn = pathlib.PureWindowsPath(pathFilename)
|
|
46
47
|
lavfiPathFilename = pFn.drive.replace(":", "\\\\:")+pathlib.PureWindowsPath(pFn.root,pFn.relative_to(pFn.anchor)).as_posix()
|
|
@@ -63,14 +64,14 @@ def ffprobeShotgunAndCache(pathFilename: str | PathLike[Any]) -> dict[str, float
|
|
|
63
64
|
stdoutFFprobe, _DISCARDstderr = systemProcessFFprobe.communicate()
|
|
64
65
|
FFprobeStructured = pythonizeFFprobe(stdoutFFprobe.decode('utf-8'))[-1]
|
|
65
66
|
|
|
66
|
-
dictionaryAspectsAnalyzed: dict[str, float
|
|
67
|
+
dictionaryAspectsAnalyzed: dict[str, float] = {}
|
|
67
68
|
if 'aspectralstats' in FFprobeStructured:
|
|
68
69
|
for keyName in FFprobeStructured['aspectralstats']:
|
|
69
70
|
# No matter how many channels, each keyName is `numpy.ndarray[tuple[int, int], numpy.dtype[numpy.float64]]`
|
|
70
71
|
# where `tuple[int, int]` is (channel, frame)
|
|
71
72
|
# 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
|
-
|
|
73
|
+
# dictionaryAspectsAnalyzed[keyName] = FFprobeStructured['aspectralstats'][keyName]
|
|
74
|
+
dictionaryAspectsAnalyzed[keyName] = numpy.mean(FFprobeStructured['aspectralstats'][keyName]).astype(float)
|
|
74
75
|
if 'r128' in FFprobeStructured:
|
|
75
76
|
for keyName in FFprobeStructured['r128']:
|
|
76
77
|
dictionaryAspectsAnalyzed[keyName] = FFprobeStructured['r128'][keyName][-1]
|
|
@@ -133,55 +134,55 @@ def analyzeLUFShigh(pathFilename: str | PathLike[Any]) -> float | None:
|
|
|
133
134
|
return ffprobeShotgunAndCache(pathFilename).get('LRA.high')
|
|
134
135
|
|
|
135
136
|
@registrationAudioAspect('Power spectral density')
|
|
136
|
-
def analyzeMean(pathFilename: str | PathLike[Any]) ->
|
|
137
|
+
def analyzeMean(pathFilename: str | PathLike[Any]) -> float | None:
|
|
137
138
|
return ffprobeShotgunAndCache(pathFilename).get('mean')
|
|
138
139
|
|
|
139
140
|
@registrationAudioAspect('Spectral variance')
|
|
140
|
-
def analyzeVariance(pathFilename: str | PathLike[Any]) ->
|
|
141
|
+
def analyzeVariance(pathFilename: str | PathLike[Any]) -> float | None:
|
|
141
142
|
return ffprobeShotgunAndCache(pathFilename).get('variance')
|
|
142
143
|
|
|
143
144
|
@registrationAudioAspect('Spectral centroid')
|
|
144
|
-
def analyzeCentroid(pathFilename: str | PathLike[Any]) ->
|
|
145
|
+
def analyzeCentroid(pathFilename: str | PathLike[Any]) -> float | None:
|
|
145
146
|
return ffprobeShotgunAndCache(pathFilename).get('centroid')
|
|
146
147
|
|
|
147
148
|
@registrationAudioAspect('Spectral spread')
|
|
148
|
-
def analyzeSpread(pathFilename: str | PathLike[Any]) ->
|
|
149
|
+
def analyzeSpread(pathFilename: str | PathLike[Any]) -> float | None:
|
|
149
150
|
return ffprobeShotgunAndCache(pathFilename).get('spread')
|
|
150
151
|
|
|
151
152
|
@registrationAudioAspect('Spectral skewness')
|
|
152
|
-
def analyzeSkewness(pathFilename: str | PathLike[Any]) ->
|
|
153
|
+
def analyzeSkewness(pathFilename: str | PathLike[Any]) -> float | None:
|
|
153
154
|
return ffprobeShotgunAndCache(pathFilename).get('skewness')
|
|
154
155
|
|
|
155
156
|
@registrationAudioAspect('Spectral kurtosis')
|
|
156
|
-
def analyzeKurtosis(pathFilename: str | PathLike[Any]) ->
|
|
157
|
+
def analyzeKurtosis(pathFilename: str | PathLike[Any]) -> float | None:
|
|
157
158
|
return ffprobeShotgunAndCache(pathFilename).get('kurtosis')
|
|
158
159
|
|
|
159
160
|
@registrationAudioAspect('Spectral entropy')
|
|
160
|
-
def analyzeSpectralEntropy(pathFilename: str | PathLike[Any]) ->
|
|
161
|
+
def analyzeSpectralEntropy(pathFilename: str | PathLike[Any]) -> float | None:
|
|
161
162
|
return ffprobeShotgunAndCache(pathFilename).get('entropy')
|
|
162
163
|
|
|
163
164
|
@registrationAudioAspect('Spectral flatness')
|
|
164
|
-
def analyzeFlatness(pathFilename: str | PathLike[Any]) ->
|
|
165
|
+
def analyzeFlatness(pathFilename: str | PathLike[Any]) -> float | None:
|
|
165
166
|
return ffprobeShotgunAndCache(pathFilename).get('flatness')
|
|
166
167
|
|
|
167
168
|
@registrationAudioAspect('Spectral crest')
|
|
168
|
-
def analyzeCrest(pathFilename: str | PathLike[Any]) ->
|
|
169
|
+
def analyzeCrest(pathFilename: str | PathLike[Any]) -> float | None:
|
|
169
170
|
return ffprobeShotgunAndCache(pathFilename).get('crest')
|
|
170
171
|
|
|
171
172
|
@registrationAudioAspect('Spectral flux')
|
|
172
|
-
def analyzeFlux(pathFilename: str | PathLike[Any]) ->
|
|
173
|
+
def analyzeFlux(pathFilename: str | PathLike[Any]) -> float | None:
|
|
173
174
|
return ffprobeShotgunAndCache(pathFilename).get('flux')
|
|
174
175
|
|
|
175
176
|
@registrationAudioAspect('Spectral slope')
|
|
176
|
-
def analyzeSlope(pathFilename: str | PathLike[Any]) ->
|
|
177
|
+
def analyzeSlope(pathFilename: str | PathLike[Any]) -> float | None:
|
|
177
178
|
return ffprobeShotgunAndCache(pathFilename).get('slope')
|
|
178
179
|
|
|
179
180
|
@registrationAudioAspect('Spectral decrease')
|
|
180
|
-
def analyzeDecrease(pathFilename: str | PathLike[Any]) ->
|
|
181
|
+
def analyzeDecrease(pathFilename: str | PathLike[Any]) -> float | None:
|
|
181
182
|
return ffprobeShotgunAndCache(pathFilename).get('decrease')
|
|
182
183
|
|
|
183
184
|
@registrationAudioAspect('Spectral rolloff')
|
|
184
|
-
def analyzeRolloff(pathFilename: str | PathLike[Any]) ->
|
|
185
|
+
def analyzeRolloff(pathFilename: str | PathLike[Any]) -> float | None:
|
|
185
186
|
return ffprobeShotgunAndCache(pathFilename).get('rolloff')
|
|
186
187
|
|
|
187
188
|
@registrationAudioAspect('Abs_Peak_count')
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
+
"""Analyzers that use the spectrogram to analyze audio data."""
|
|
1
2
|
from analyzeAudio import registrationAudioAspect, audioAspects, cacheAudioAnalyzers
|
|
2
3
|
from typing import Any
|
|
3
4
|
import cachetools
|
|
4
5
|
import librosa
|
|
5
6
|
import numpy
|
|
6
|
-
from optype.numpy import AnyFloatingDType, ToArray3D, ToFloat3D
|
|
7
7
|
from numpy import dtype, floating
|
|
8
8
|
|
|
9
9
|
@registrationAudioAspect('Chromagram')
|
|
10
|
-
def analyzeChromagram(spectrogramPower: numpy.ndarray[Any, dtype[floating[Any]]], sampleRate: int, **keywordArguments: Any) -> numpy.ndarray:
|
|
11
|
-
return librosa.feature.chroma_stft(S=spectrogramPower, sr=sampleRate, **keywordArguments)
|
|
10
|
+
def analyzeChromagram(spectrogramPower: numpy.ndarray[Any, dtype[floating[Any]]], sampleRate: int, **keywordArguments: Any) -> numpy.ndarray: # pyright: ignore [reportMissingTypeArgument, reportUnknownParameterType]
|
|
11
|
+
return librosa.feature.chroma_stft(S=spectrogramPower, sr=sampleRate, **keywordArguments) # type: ignore
|
|
12
12
|
|
|
13
13
|
@registrationAudioAspect('Spectral Contrast')
|
|
14
|
-
def analyzeSpectralContrast(spectrogramMagnitude: numpy.ndarray[Any, dtype[floating[Any]]], **keywordArguments: Any) -> numpy.ndarray:
|
|
15
|
-
return librosa.feature.spectral_contrast(S=spectrogramMagnitude, **keywordArguments)
|
|
14
|
+
def analyzeSpectralContrast(spectrogramMagnitude: numpy.ndarray[Any, dtype[floating[Any]]], **keywordArguments: Any) -> numpy.ndarray: # pyright: ignore [reportMissingTypeArgument, reportUnknownParameterType]
|
|
15
|
+
return librosa.feature.spectral_contrast(S=spectrogramMagnitude, **keywordArguments) # type: ignore
|
|
16
16
|
|
|
17
17
|
@registrationAudioAspect('Spectral Bandwidth')
|
|
18
|
-
def analyzeSpectralBandwidth(spectrogramMagnitude: numpy.ndarray[Any, dtype[floating[Any]]], **keywordArguments: Any) -> numpy.ndarray:
|
|
18
|
+
def analyzeSpectralBandwidth(spectrogramMagnitude: numpy.ndarray[Any, dtype[floating[Any]]], **keywordArguments: Any) -> numpy.ndarray: # pyright: ignore [reportMissingTypeArgument, reportUnknownParameterType]
|
|
19
19
|
centroid = audioAspects['Spectral Centroid']['analyzer'](spectrogramMagnitude)
|
|
20
|
-
return librosa.feature.spectral_bandwidth(S=spectrogramMagnitude, centroid=centroid, **keywordArguments)
|
|
20
|
+
return librosa.feature.spectral_bandwidth(S=spectrogramMagnitude, centroid=centroid, **keywordArguments) # type: ignore
|
|
21
21
|
|
|
22
22
|
@cachetools.cached(cache=cacheAudioAnalyzers)
|
|
23
23
|
@registrationAudioAspect('Spectral Centroid')
|
|
24
|
-
def analyzeSpectralCentroid(spectrogramMagnitude: numpy.ndarray[Any, dtype[floating[Any]]], **keywordArguments: Any) -> numpy.ndarray:
|
|
25
|
-
return librosa.feature.spectral_centroid(S=spectrogramMagnitude, **keywordArguments)
|
|
24
|
+
def analyzeSpectralCentroid(spectrogramMagnitude: numpy.ndarray[Any, dtype[floating[Any]]], **keywordArguments: Any) -> numpy.ndarray: # pyright: ignore [reportMissingTypeArgument, reportUnknownParameterType]
|
|
25
|
+
return librosa.feature.spectral_centroid(S=spectrogramMagnitude, **keywordArguments) # type: ignore
|
|
26
26
|
|
|
27
27
|
@registrationAudioAspect('Spectral Flatness')
|
|
28
|
-
def analyzeSpectralFlatness(spectrogramMagnitude: numpy.ndarray[Any, dtype[floating[Any]]], **keywordArguments: Any) -> numpy.ndarray:
|
|
29
|
-
spectralFlatness = librosa.feature.spectral_flatness(S=spectrogramMagnitude, **keywordArguments)
|
|
28
|
+
def analyzeSpectralFlatness(spectrogramMagnitude: numpy.ndarray[Any, dtype[floating[Any]]], **keywordArguments: Any) -> numpy.ndarray: # pyright: ignore [reportMissingTypeArgument, reportUnknownParameterType]
|
|
29
|
+
spectralFlatness: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.floating[Any]]] = librosa.feature.spectral_flatness(S=spectrogramMagnitude, **keywordArguments) # type: ignore
|
|
30
30
|
return 20 * numpy.log10(spectralFlatness, where=(spectralFlatness != 0)) # dB
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"""Analyzers that use the tensor to analyze audio data."""
|
|
1
2
|
from analyzeAudio import registrationAudioAspect
|
|
2
3
|
from torchmetrics.functional.audio.srmr import speech_reverberation_modulation_energy_ratio
|
|
3
4
|
from typing import Any
|
|
@@ -5,6 +6,6 @@ import numpy
|
|
|
5
6
|
import torch
|
|
6
7
|
|
|
7
8
|
@registrationAudioAspect('SRMR')
|
|
8
|
-
def analyzeSRMR(tensorAudio: torch.Tensor, sampleRate: int, pytorchOnCPU: bool | None, **keywordArguments: Any) -> numpy.ndarray:
|
|
9
|
+
def analyzeSRMR(tensorAudio: torch.Tensor, sampleRate: int, pytorchOnCPU: bool | None, **keywordArguments: Any) -> numpy.ndarray: # pyright: ignore [reportMissingTypeArgument, reportUnknownParameterType]
|
|
9
10
|
keywordArguments['fast'] = keywordArguments.get('fast') or pytorchOnCPU or None
|
|
10
|
-
return torch.Tensor.numpy(speech_reverberation_modulation_energy_ratio(tensorAudio, sampleRate, **keywordArguments))
|
|
11
|
+
return torch.Tensor.numpy(speech_reverberation_modulation_energy_ratio(tensorAudio, sampleRate, **keywordArguments)) # type: ignore
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
+
"""Analyzers that use the waveform of audio data."""
|
|
1
2
|
from analyzeAudio import registrationAudioAspect, audioAspects, cacheAudioAnalyzers
|
|
2
3
|
from typing import Any
|
|
3
4
|
import librosa
|
|
4
5
|
import numpy
|
|
5
|
-
from optype.numpy import ToArray2D, AnyFloatingDType
|
|
6
6
|
import cachetools
|
|
7
7
|
|
|
8
8
|
@cachetools.cached(cache=cacheAudioAnalyzers)
|
|
9
9
|
@registrationAudioAspect('Tempogram')
|
|
10
|
-
def analyzeTempogram(waveform:
|
|
11
|
-
return librosa.feature.tempogram(y=waveform, sr=sampleRate, **keywordArguments)
|
|
10
|
+
def analyzeTempogram(waveform: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.floating[Any]]], sampleRate: int, **keywordArguments: Any) -> numpy.ndarray: # pyright: ignore [reportMissingTypeArgument, reportUnknownParameterType]
|
|
11
|
+
return librosa.feature.tempogram(y=waveform, sr=sampleRate, **keywordArguments) # type: ignore
|
|
12
12
|
|
|
13
13
|
# "RMS value from audio samples is faster ... However, ... spectrogram ... more accurate ... because ... windowed"
|
|
14
14
|
@registrationAudioAspect('RMS from waveform')
|
|
15
|
-
def analyzeRMS(waveform:
|
|
16
|
-
arrayRMS = librosa.feature.rms(y=waveform, **keywordArguments)
|
|
15
|
+
def analyzeRMS(waveform: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.floating[Any]]], **keywordArguments: Any) -> numpy.ndarray: # pyright: ignore [reportMissingTypeArgument, reportUnknownParameterType]
|
|
16
|
+
arrayRMS: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.floating[Any]]] = librosa.feature.rms(y=waveform, **keywordArguments) # type: ignore
|
|
17
17
|
return 20 * numpy.log10(arrayRMS, where=(arrayRMS != 0)) # dB
|
|
18
18
|
|
|
19
19
|
@registrationAudioAspect('Tempo')
|
|
20
|
-
def analyzeTempo(waveform:
|
|
20
|
+
def analyzeTempo(waveform: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.floating[Any]]], sampleRate: int, **keywordArguments: Any) -> numpy.ndarray: # pyright: ignore [reportMissingTypeArgument, reportUnknownParameterType]
|
|
21
21
|
tempogram = audioAspects['Tempogram']['analyzer'](waveform, sampleRate)
|
|
22
|
-
return librosa.feature.tempo(y=waveform, sr=sampleRate, tg=tempogram, **keywordArguments)
|
|
22
|
+
return librosa.feature.tempo(y=waveform, sr=sampleRate, tg=tempogram, **keywordArguments) # type: ignore
|
|
23
23
|
|
|
24
24
|
@registrationAudioAspect('Zero-crossing rate') # This is distinct from 'Zero-crossings rate'
|
|
25
|
-
def analyzeZeroCrossingRate(waveform:
|
|
26
|
-
return librosa.feature.zero_crossing_rate(y=waveform, **keywordArguments)
|
|
25
|
+
def analyzeZeroCrossingRate(waveform: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.floating[Any]]], **keywordArguments: Any) -> numpy.ndarray: # pyright: ignore [reportMissingTypeArgument, reportUnknownParameterType]
|
|
26
|
+
return librosa.feature.zero_crossing_rate(y=waveform, **keywordArguments) # type: ignore
|
|
@@ -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
|
-
from Z0Z_tools import defineConcurrencyLimit, oopsieKwargsie, stft
|
|
6
|
+
from Z0Z_tools import defineConcurrencyLimit, oopsieKwargsie, stft, Spectrogram
|
|
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
|
|
|
@@ -101,7 +102,7 @@ def analyzeAudioFile(pathFilename: str | PathLike[Any], listAspectNames: list[st
|
|
|
101
102
|
|
|
102
103
|
# I need "lazy" loading
|
|
103
104
|
tryAgain = True
|
|
104
|
-
while tryAgain:
|
|
105
|
+
while tryAgain:
|
|
105
106
|
try:
|
|
106
107
|
tensorAudio = torch.from_numpy(waveform) # memory-sharing
|
|
107
108
|
tryAgain = False
|
analyzeAudio/py.typed
ADDED
|
File without changes
|
analyzeAudio/pythonator.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"""Convert FFprobe output to a standardized Python object."""
|
|
1
2
|
from collections import defaultdict
|
|
2
3
|
from typing import Any, cast, NamedTuple
|
|
3
4
|
import json
|
|
@@ -89,7 +90,7 @@ def pythonizeFFprobe(FFprobeJSON_utf8: str):
|
|
|
89
90
|
Z0Z_dictionaries[registrant] = {}
|
|
90
91
|
elif statistic not in Z0Z_dictionaries[registrant]:
|
|
91
92
|
# NOTE (as of this writing) `registrar` can only understand the generic class `numpy.ndarray` and not more specific typing
|
|
92
|
-
valueSherpa = cast(numpy.ndarray, numpy.zeros((channel, len(FFroot['frames']))))
|
|
93
|
+
valueSherpa = cast(numpy.ndarray, numpy.zeros((channel, len(FFroot['frames'])))) # type: ignore
|
|
93
94
|
Z0Z_dictionaries[registrant][statistic] = valueSherpa
|
|
94
95
|
else:
|
|
95
96
|
raise # Re-raise the exception
|
|
@@ -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.16
|
|
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
|
|
@@ -36,7 +35,6 @@ License-File: LICENSE
|
|
|
36
35
|
Requires-Dist: cachetools
|
|
37
36
|
Requires-Dist: librosa
|
|
38
37
|
Requires-Dist: numpy
|
|
39
|
-
Requires-Dist: optype[numpy]
|
|
40
38
|
Requires-Dist: standard-aifc; python_version >= "3.13"
|
|
41
39
|
Requires-Dist: standard-sunau; python_version >= "3.13"
|
|
42
40
|
Requires-Dist: torch
|
|
@@ -44,10 +42,11 @@ Requires-Dist: torchmetrics[audio]
|
|
|
44
42
|
Requires-Dist: tqdm
|
|
45
43
|
Requires-Dist: Z0Z_tools
|
|
46
44
|
Provides-Extra: testing
|
|
45
|
+
Requires-Dist: pytest; extra == "testing"
|
|
47
46
|
Requires-Dist: pytest-cov; extra == "testing"
|
|
48
47
|
Requires-Dist: pytest-xdist; extra == "testing"
|
|
49
|
-
Requires-Dist: pytest; extra == "testing"
|
|
50
48
|
Requires-Dist: pyupgrade; extra == "testing"
|
|
49
|
+
Dynamic: license-file
|
|
51
50
|
|
|
52
51
|
# analyzeAudio
|
|
53
52
|
|
|
@@ -139,12 +138,45 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
139
138
|
'Signal entropy': float
|
|
140
139
|
'Spectral Bandwidth': NDArray[float64] # shape(..., 1, frames)
|
|
141
140
|
'Spectral Bandwidth mean': float
|
|
142
|
-
'Spectral centroid': NDArray[float64] # shape(channels, frames)
|
|
143
|
-
'Spectral centroid mean': float
|
|
144
141
|
'Spectral Centroid': NDArray[float64] # shape(..., 1, frames)
|
|
145
142
|
'Spectral Centroid mean': float
|
|
146
143
|
'Spectral Contrast': NDArray[float64] # shape(..., 7, frames)
|
|
147
144
|
'Spectral Contrast mean': float
|
|
145
|
+
'Spectral Flatness': NDArray[float64] # shape(..., 1, frames)
|
|
146
|
+
'Spectral Flatness mean': float
|
|
147
|
+
'SRMR': NDArray[float64] # shape(...)
|
|
148
|
+
'SRMR mean': float
|
|
149
|
+
'Tempo': NDArray[float64] # shape(...)
|
|
150
|
+
'Tempo mean': float
|
|
151
|
+
'Tempogram': NDArray[float64] # shape(..., 384, samples)
|
|
152
|
+
'Tempogram mean': float
|
|
153
|
+
'Zero-crossing rate': NDArray[float64] # shape(..., 1, frames)
|
|
154
|
+
'Zero-crossing rate mean': float
|
|
155
|
+
'Zero-crossings rate': float
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### I had to revert back to these
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
'Spectral centroid': float
|
|
162
|
+
'Spectral crest': float
|
|
163
|
+
'Spectral decrease': float
|
|
164
|
+
'Spectral entropy': float
|
|
165
|
+
'Spectral flatness': float
|
|
166
|
+
'Spectral flux': float
|
|
167
|
+
'Spectral kurtosis': float
|
|
168
|
+
'Spectral rolloff': float
|
|
169
|
+
'Spectral skewness': float
|
|
170
|
+
'Spectral slope': float
|
|
171
|
+
'Spectral spread': float
|
|
172
|
+
'Spectral variance': float
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Removed (temporarily, I hope)
|
|
176
|
+
|
|
177
|
+
```python
|
|
178
|
+
'Spectral centroid': NDArray[float64] # shape(channels, frames)
|
|
179
|
+
'Spectral centroid mean': float
|
|
148
180
|
'Spectral crest': NDArray[float64] # shape(channels, frames)
|
|
149
181
|
'Spectral crest mean': float
|
|
150
182
|
'Spectral decrease': NDArray[float64] # shape(channels, frames)
|
|
@@ -153,8 +185,6 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
153
185
|
'Spectral entropy mean': float
|
|
154
186
|
'Spectral flatness': NDArray[float64] # shape(channels, frames)
|
|
155
187
|
'Spectral flatness mean': float
|
|
156
|
-
'Spectral Flatness': NDArray[float64] # shape(..., 1, frames)
|
|
157
|
-
'Spectral Flatness mean': float
|
|
158
188
|
'Spectral flux': NDArray[float64] # shape(channels, frames)
|
|
159
189
|
'Spectral flux mean': float
|
|
160
190
|
'Spectral kurtosis': NDArray[float64] # shape(channels, frames)
|
|
@@ -169,15 +199,6 @@ print(audioAspects['Chromagram']['analyzerParameters'])
|
|
|
169
199
|
'Spectral spread mean': float
|
|
170
200
|
'Spectral variance': NDArray[float64] # shape(channels, frames)
|
|
171
201
|
'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
202
|
```
|
|
182
203
|
|
|
183
204
|
## Installation
|
|
@@ -191,4 +212,13 @@ pip install analyzeAudio
|
|
|
191
212
|
[](https://HunterThinks.com/support)
|
|
192
213
|
[](https://www.youtube.com/@HunterHogan)
|
|
193
214
|
|
|
194
|
-
|
|
215
|
+
## How to code
|
|
216
|
+
|
|
217
|
+
Coding One Step at a Time:
|
|
218
|
+
|
|
219
|
+
0. WRITE CODE.
|
|
220
|
+
1. Don't write stupid code that's hard to revise.
|
|
221
|
+
2. Write good code.
|
|
222
|
+
3. When revising, write better code.
|
|
223
|
+
|
|
224
|
+
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
analyzeAudio/__init__.py,sha256=2D5JMeZfLGnwyQvt4Q2-HCsShHulcNXBM_Wu9vZPCiI,437
|
|
2
|
+
analyzeAudio/analyzersUseFilename.py,sha256=AOA_Ab6-QU4q4i7AOy9Z68yPiGBi-Zjpo4zYmqvOwuM,11021
|
|
3
|
+
analyzeAudio/analyzersUseSpectrogram.py,sha256=RjKW9it_9EDgKwkx9sB99z7qbLrVq5xM7ALTcwo4xE8,2346
|
|
4
|
+
analyzeAudio/analyzersUseTensor.py,sha256=oRxKw42Q4bdBhuSlwdyVo2MNgI0AbnjEjpnRLQVaqco,701
|
|
5
|
+
analyzeAudio/analyzersUseWaveform.py,sha256=2nGhwdpDpamAAgeZ4XAbtX1aGAn5R-VIwHO1qnyxz0U,2042
|
|
6
|
+
analyzeAudio/audioAspectsRegistry.py,sha256=NoRUflTxls4palGtc7iQsfMLc9nMGITCVRPhDehNFJ4,8564
|
|
7
|
+
analyzeAudio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
analyzeAudio/pythonator.py,sha256=hL2KzeO7cgboSCL9uOl1uyuWMrnR0xhDt9o78GkM2_0,5680
|
|
9
|
+
analyzeaudio-0.0.16.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=sd20ms4StQ13_3-gmwZwtAuoIAwfxWC5IXM_Cp5GQXM,428
|
|
13
|
+
analyzeaudio-0.0.16.dist-info/METADATA,sha256=Nn-a1bKLTdVvwmayCHEA8SdelzcSDhmbCJyMrdIv5XU,9178
|
|
14
|
+
analyzeaudio-0.0.16.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
15
|
+
analyzeaudio-0.0.16.dist-info/entry_points.txt,sha256=FHgSx7fndtZ6SnQ-nWVXf0NB59exaHQ2DtatTK9KrLg,100
|
|
16
|
+
analyzeaudio-0.0.16.dist-info/top_level.txt,sha256=QV8LQ0r_1LIQuewxDcEzODpykv5qRYG3I70piOUSVRg,19
|
|
17
|
+
analyzeaudio-0.0.16.dist-info/RECORD,,
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
analyzeAudio/__init__.py,sha256=2D5JMeZfLGnwyQvt4Q2-HCsShHulcNXBM_Wu9vZPCiI,437
|
|
2
|
-
analyzeAudio/analyzersUseFilename.py,sha256=iXF3Ut_Ldd6hKtNC54vpwRLGaQQA0UdE83aCMcFfVGI,10972
|
|
3
|
-
analyzeAudio/analyzersUseSpectrogram.py,sha256=j-e69ICVHOC_W3ev8HOTem4KGGpE9QyKnYZEvFseMkE,1835
|
|
4
|
-
analyzeAudio/analyzersUseTensor.py,sha256=-wD_QAd41lB65ceT5UedEoxWL078tZ0E-kC9ssDSghc,553
|
|
5
|
-
analyzeAudio/analyzersUseWaveform.py,sha256=AwDyagz9bLLAq8ji4by51x7d2YWRdUQaY3iaw1k0yD4,1472
|
|
6
|
-
analyzeAudio/audioAspectsRegistry.py,sha256=EvFKNncWKDv4KDyI0UcfBplkgVK_fGOFOdjolDy8hE0,8517
|
|
7
|
-
analyzeAudio/pythonator.py,sha256=St6KmIxvHwoW6IuHcEJjjvUUrEkG0sPv2S3Th9rjJtE,5603
|
|
8
|
-
tests/conftest.py,sha256=BhZswOjkl_u-qiS4Zy38d2fETdWAtZiigeuXYBK8l0k,397
|
|
9
|
-
tests/test_audioAspectsRegistry.py,sha256=-TWTLMdAn6IFv7ZdFWrBm1KxpLBa3Mz1sCygAwxV6gE,27
|
|
10
|
-
tests/test_other.py,sha256=sd20ms4StQ13_3-gmwZwtAuoIAwfxWC5IXM_Cp5GQXM,428
|
|
11
|
-
analyzeaudio-0.0.14.dist-info/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
|
|
12
|
-
analyzeaudio-0.0.14.dist-info/METADATA,sha256=Q_oiZl_dpECEzAv33Zla9SuVugUKr0sw9IZuUxPGaZs,8659
|
|
13
|
-
analyzeaudio-0.0.14.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
14
|
-
analyzeaudio-0.0.14.dist-info/entry_points.txt,sha256=FHgSx7fndtZ6SnQ-nWVXf0NB59exaHQ2DtatTK9KrLg,100
|
|
15
|
-
analyzeaudio-0.0.14.dist-info/top_level.txt,sha256=QV8LQ0r_1LIQuewxDcEzODpykv5qRYG3I70piOUSVRg,19
|
|
16
|
-
analyzeaudio-0.0.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|