pysilero-vad 2.0.0__py3-none-any.whl → 2.1.0__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.
- pysilero_vad/__init__.py +11 -0
- {pysilero_vad-2.0.0.dist-info → pysilero_vad-2.1.0.dist-info}/METADATA +18 -12
- pysilero_vad-2.1.0.dist-info/RECORD +9 -0
- {pysilero_vad-2.0.0.dist-info → pysilero_vad-2.1.0.dist-info}/WHEEL +1 -1
- pysilero_vad-2.1.0.dist-info/zip-safe +1 -0
- pysilero_vad-2.0.0.dist-info/RECORD +0 -8
- {pysilero_vad-2.0.0.dist-info → pysilero_vad-2.1.0.dist-info/licenses}/LICENSE.md +0 -0
- {pysilero_vad-2.0.0.dist-info → pysilero_vad-2.1.0.dist-info}/top_level.txt +0 -0
pysilero_vad/__init__.py
CHANGED
@@ -73,6 +73,17 @@ class SileroVoiceActivityDetector:
|
|
73
73
|
|
74
74
|
audio_array = np.frombuffer(audio, dtype=np.int16).astype(np.float32) / _MAX_WAV
|
75
75
|
|
76
|
+
return self.process_array(audio_array)
|
77
|
+
|
78
|
+
def process_array(self, audio_array: np.ndarray) -> float:
|
79
|
+
"""Return probability of speech [0-1] in a single audio chunk.
|
80
|
+
|
81
|
+
Audio *must* be 512 float samples [0-1] of 16Khz mono.
|
82
|
+
"""
|
83
|
+
if len(audio_array) != _CHUNK_SAMPLES:
|
84
|
+
# Window size is fixed at 512 samples in v5
|
85
|
+
raise InvalidChunkSizeError
|
86
|
+
|
76
87
|
# Add batch dimension and context
|
77
88
|
audio_array = np.concatenate(
|
78
89
|
(self._context, audio_array[np.newaxis, :]), axis=1
|
@@ -1,25 +1,28 @@
|
|
1
|
-
Metadata-Version: 2.
|
2
|
-
Name:
|
3
|
-
Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: pysilero_vad
|
3
|
+
Version: 2.1.0
|
4
4
|
Summary: Pre-packaged voice activity detector using silero-vad
|
5
|
-
|
6
|
-
Author: Michael Hansen
|
7
|
-
Author-email: mike@rhasspy.org
|
5
|
+
Author-email: Michael Hansen <mike@rhasspy.org>
|
8
6
|
License: MIT
|
9
|
-
|
7
|
+
Project-URL: Source Code, http://github.com/rhasspy/pysilero-vad
|
8
|
+
Keywords: voice,activity,vad
|
9
|
+
Platform: any
|
10
10
|
Classifier: Development Status :: 3 - Alpha
|
11
11
|
Classifier: Intended Audience :: Developers
|
12
|
-
Classifier: Topic ::
|
12
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
13
13
|
Classifier: License :: OSI Approved :: MIT License
|
14
|
-
Classifier: Programming Language :: Python :: 3.7
|
15
14
|
Classifier: Programming Language :: Python :: 3.8
|
16
15
|
Classifier: Programming Language :: Python :: 3.9
|
17
16
|
Classifier: Programming Language :: Python :: 3.10
|
18
17
|
Classifier: Programming Language :: Python :: 3.11
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
20
|
+
Requires-Python: >=3.8.0
|
19
21
|
Description-Content-Type: text/markdown
|
20
22
|
License-File: LICENSE.md
|
21
|
-
Requires-Dist: onnxruntime
|
22
|
-
Requires-Dist: numpy
|
23
|
+
Requires-Dist: onnxruntime<2,>=1.18.0
|
24
|
+
Requires-Dist: numpy
|
25
|
+
Dynamic: license-file
|
23
26
|
|
24
27
|
# pySilero VAD
|
25
28
|
|
@@ -34,7 +37,10 @@ from pysilero_vad import SileroVoiceActivityDetector
|
|
34
37
|
|
35
38
|
vad = SileroVoiceActivityDetector()
|
36
39
|
|
37
|
-
# Audio must be 16Khz, 16-bit mono PCM
|
40
|
+
# Audio must be 16Khz, 16-bit mono PCM with correct chunk size
|
41
|
+
# See also: vad.chunk_samples()
|
42
|
+
assert len(audio_bytes) == vad.chunk_bytes()
|
43
|
+
|
38
44
|
if vad(audio_bytes) >= 0.5:
|
39
45
|
print("Speech")
|
40
46
|
else:
|
@@ -0,0 +1,9 @@
|
|
1
|
+
pysilero_vad/__init__.py,sha256=mq_sBAonBDol7f3TMeYUofUTk3ZPESGdolsAiDWzIJU,3835
|
2
|
+
pysilero_vad/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
+
pysilero_vad/models/silero_vad.onnx,sha256=a5nL_Tkka2cG-Y7BPHxQxrKZGB8kdPoFy8gEaswnQ5Y,2313101
|
4
|
+
pysilero_vad-2.1.0.dist-info/licenses/LICENSE.md,sha256=E3RtUJ105V6iJl--8gS7fNv4SoMVsCB-mIMmy1Q4cCg,1071
|
5
|
+
pysilero_vad-2.1.0.dist-info/METADATA,sha256=Odwa6zy58E5aXb4n94GcjDKdPEPtgDGkxigblW3yeEc,1430
|
6
|
+
pysilero_vad-2.1.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
7
|
+
pysilero_vad-2.1.0.dist-info/top_level.txt,sha256=QQlOVbq_uDMukkVxjBFRi8eOwSrzJDrbP8YY1MCeMIs,13
|
8
|
+
pysilero_vad-2.1.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
9
|
+
pysilero_vad-2.1.0.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -1,8 +0,0 @@
|
|
1
|
-
pysilero_vad/__init__.py,sha256=_QtP_z0JjpOkSHMaqRFuSI9Bf0oL-k8IJE0hmZdZDLk,3433
|
2
|
-
pysilero_vad/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
pysilero_vad/models/silero_vad.onnx,sha256=a5nL_Tkka2cG-Y7BPHxQxrKZGB8kdPoFy8gEaswnQ5Y,2313101
|
4
|
-
pysilero_vad-2.0.0.dist-info/LICENSE.md,sha256=E3RtUJ105V6iJl--8gS7fNv4SoMVsCB-mIMmy1Q4cCg,1071
|
5
|
-
pysilero_vad-2.0.0.dist-info/METADATA,sha256=4sEHoBxuoETlfmDQvSW6D218o_itohlm7AqlAbhdXYA,1216
|
6
|
-
pysilero_vad-2.0.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
7
|
-
pysilero_vad-2.0.0.dist-info/top_level.txt,sha256=QQlOVbq_uDMukkVxjBFRi8eOwSrzJDrbP8YY1MCeMIs,13
|
8
|
-
pysilero_vad-2.0.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|