sonusai 0.14.1__py3-none-any.whl → 0.14.2__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.
- sonusai/mixture/audio.py +6 -2
- sonusai/mixture/torchaudio_audio.py +2 -2
- {sonusai-0.14.1.dist-info → sonusai-0.14.2.dist-info}/METADATA +2 -1
- {sonusai-0.14.1.dist-info → sonusai-0.14.2.dist-info}/RECORD +6 -6
- {sonusai-0.14.1.dist-info → sonusai-0.14.2.dist-info}/WHEEL +0 -0
- {sonusai-0.14.1.dist-info → sonusai-0.14.2.dist-info}/entry_points.txt +0 -0
sonusai/mixture/audio.py
CHANGED
@@ -59,6 +59,7 @@ def get_duration(audio: AudioT) -> float:
|
|
59
59
|
:return: Duration of audio in seconds
|
60
60
|
"""
|
61
61
|
from .constants import SAMPLE_RATE
|
62
|
+
|
62
63
|
return len(audio) / SAMPLE_RATE
|
63
64
|
|
64
65
|
|
@@ -66,14 +67,15 @@ def validate_input_file(input_filepath: str) -> None:
|
|
66
67
|
from os.path import exists
|
67
68
|
from os.path import splitext
|
68
69
|
|
69
|
-
from
|
70
|
+
from soundfile import available_formats
|
70
71
|
|
71
72
|
from sonusai import SonusAIError
|
73
|
+
|
72
74
|
if not exists(input_filepath):
|
73
75
|
raise SonusAIError(f'input_filepath {input_filepath} does not exist.')
|
74
76
|
|
75
77
|
ext = splitext(input_filepath)[1][1:].lower()
|
76
|
-
read_formats =
|
78
|
+
read_formats = [item.lower() for item in available_formats().keys()]
|
77
79
|
if ext not in read_formats:
|
78
80
|
raise SonusAIError(f'This installation of SoX cannot process .{ext} files')
|
79
81
|
|
@@ -86,6 +88,7 @@ def read_audio(name: Location) -> AudioT:
|
|
86
88
|
:return: Array of time domain audio data
|
87
89
|
"""
|
88
90
|
from .torchaudio_audio import read_torchaudio_audio
|
91
|
+
|
89
92
|
return read_torchaudio_audio(name)
|
90
93
|
|
91
94
|
|
@@ -97,4 +100,5 @@ def read_ir(name: Location) -> ImpulseResponseData:
|
|
97
100
|
:return: ImpulseResponseData object
|
98
101
|
"""
|
99
102
|
from .torchaudio_audio import read_torchaudio_ir
|
103
|
+
|
100
104
|
return read_torchaudio_ir(name)
|
@@ -21,7 +21,7 @@ def read_torchaudio_ir(name: Location) -> ImpulseResponseData:
|
|
21
21
|
|
22
22
|
# Read impulse response data from audio file
|
23
23
|
try:
|
24
|
-
raw, sample_rate = torchaudio.load(expanded_name)
|
24
|
+
raw, sample_rate = torchaudio.load(expanded_name, backend='soundfile')
|
25
25
|
except Exception as e:
|
26
26
|
if name != expanded_name:
|
27
27
|
raise SonusAIError(f'Error reading {name} (expanded: {expanded_name}): {e}')
|
@@ -58,7 +58,7 @@ def read_torchaudio_audio(name: Location) -> AudioT:
|
|
58
58
|
expanded_name, _ = tokenized_expand(name)
|
59
59
|
|
60
60
|
try:
|
61
|
-
out, samplerate = torchaudio.load(expanded_name)
|
61
|
+
out, samplerate = torchaudio.load(expanded_name, backend='soundfile')
|
62
62
|
out = torch.reshape(out[0, :], (1, out.size()[1]))
|
63
63
|
|
64
64
|
if not samplerate == SAMPLE_RATE:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sonusai
|
3
|
-
Version: 0.14.
|
3
|
+
Version: 0.14.2
|
4
4
|
Summary: Framework for building deep neural network models for sound, speech, and voice AI
|
5
5
|
Home-page: https://aaware.com
|
6
6
|
License: GPL-3.0-only
|
@@ -34,6 +34,7 @@ Requires-Dist: pystoi (>=0.3.3,<0.4.0)
|
|
34
34
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
35
35
|
Requires-Dist: scikit-learn (>=1.3.1,<2.0.0)
|
36
36
|
Requires-Dist: sh (>=2.0.6,<3.0.0)
|
37
|
+
Requires-Dist: soundfile (>=0.12.1,<0.13.0)
|
37
38
|
Requires-Dist: sox (>=1.4.1,<2.0.0)
|
38
39
|
Requires-Dist: speechrecognition (>=3.10.0,<4.0.0)
|
39
40
|
Requires-Dist: sqlalchemy[mypy] (>=2.0.22,<3.0.0)
|
@@ -33,7 +33,7 @@ sonusai/metrics/confusion_matrix_summary.py,sha256=3qg6TMKjJeHtNjj2YnNjPFSlMrQXt
|
|
33
33
|
sonusai/metrics/one_hot.py,sha256=lq58zKw0X9sdhJYGEldAkxPFqP3UOYpG_KdxkGHF_3c,13540
|
34
34
|
sonusai/metrics/snr_summary.py,sha256=P4U5_Xr7v9F8kF-rZBnpsVNt3p42rIVS6zmch8yfVfg,5575
|
35
35
|
sonusai/mixture/__init__.py,sha256=xlGw2FXoMZm2ra97GVfpJ-OTOp10d4dly8AXe8eJwhI,5294
|
36
|
-
sonusai/mixture/audio.py,sha256=
|
36
|
+
sonusai/mixture/audio.py,sha256=3pat-AIG_FXiGr3aPRa7DSLzolH3PodVDtve-xUuXfk,3242
|
37
37
|
sonusai/mixture/augmentation.py,sha256=HwYUJCSmRBWhdnzqKz5zZnMANT83GzJkDrPcWUm6jbg,10884
|
38
38
|
sonusai/mixture/class_count.py,sha256=27YDu1puarhp7Rd4EYWGJ-FHP8rAYGd55I6abGqCscY,988
|
39
39
|
sonusai/mixture/config.py,sha256=QrasMP-2NGocse2rF_oYkRluDDPo-czFLDEwKtQ8A54,23629
|
@@ -50,7 +50,7 @@ sonusai/mixture/spectral_mask.py,sha256=qHR2DBpbtz4u1o9sdFMRsUDVUjbof_MRKPW8uY4R
|
|
50
50
|
sonusai/mixture/target_class_balancing.py,sha256=P3gLe2SFos5_N2LWiVFwD-fa_imZH2f1qBiI55BeqXI,4768
|
51
51
|
sonusai/mixture/targets.py,sha256=n7PenQuU0pPM_LLXJHmUZ3VeSGDEk7Kdf8y473Xdm6Q,7395
|
52
52
|
sonusai/mixture/tokenized_shell_vars.py,sha256=gCxw8SQUcal6mqWKF7hOBTgSQmbJUk1nT0Gn3H8GA0U,4705
|
53
|
-
sonusai/mixture/torchaudio_audio.py,sha256=
|
53
|
+
sonusai/mixture/torchaudio_audio.py,sha256=qMYXeOSI8U8zaT9x0knPg1dHWzYmswZk7oFGAMG0Jks,2365
|
54
54
|
sonusai/mixture/torchaudio_augmentation.py,sha256=LrG19X71UYKMr69WNgJs2R4OTt1QBYu_h8WL5a4ERyE,4462
|
55
55
|
sonusai/mixture/truth.py,sha256=Is-nqLXIBM7wjYbS6yzy8mnR8JqxwSabnVHsza0rh_E,1427
|
56
56
|
sonusai/mixture/truth_functions/__init__.py,sha256=82lKYHhLy8KW3gHngrocoqwupGVLVsWdIXdYs3vhjOc,359
|
@@ -114,7 +114,7 @@ sonusai/utils/trim_docstring.py,sha256=dSrtiRsEN4wkkvKBp6WDr13RUypfqZzgH_jOBLs1o
|
|
114
114
|
sonusai/utils/wave.py,sha256=OZe8iVLbKSFv_GdQzLD9hJdBiqimK4FxJ0lVoDbbiqQ,572
|
115
115
|
sonusai/utils/yes_or_no.py,sha256=eMLXBVH0cEahiXY4W2KNORmwNQ-ba10eRtldh0y4NYg,263
|
116
116
|
sonusai/vars.py,sha256=m2AefF0m5bXWGXpJj8Pi42zWL2ydeEj7bkak3GrtMyM,940
|
117
|
-
sonusai-0.14.
|
118
|
-
sonusai-0.14.
|
119
|
-
sonusai-0.14.
|
120
|
-
sonusai-0.14.
|
117
|
+
sonusai-0.14.2.dist-info/METADATA,sha256=RR8bQ-ZUGFqZZJID86OMAAM6N0h7MYpfwJlDYf4t0v4,2819
|
118
|
+
sonusai-0.14.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
119
|
+
sonusai-0.14.2.dist-info/entry_points.txt,sha256=zMNjEphEPO6B3cD1GNpit7z-yA9tUU5-j3W2v-UWstU,92
|
120
|
+
sonusai-0.14.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|