dora-vad 0.3.8__py3-none-any.whl → 0.3.9rc2__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.
dora_vad/__init__.py CHANGED
@@ -5,7 +5,7 @@ readme_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "README.m
5
5
 
6
6
  # Read the content of the README file
7
7
  try:
8
- with open(readme_path, "r", encoding="utf-8") as f:
8
+ with open(readme_path, encoding="utf-8") as f:
9
9
  __doc__ = f.read()
10
10
  except FileNotFoundError:
11
11
  __doc__ = "README file not found."
dora_vad/main.py CHANGED
@@ -1,13 +1,14 @@
1
- from dora import Node
2
- import pyarrow as pa
3
- import numpy as np
4
1
  import os
5
- from silero_vad import load_silero_vad, get_speech_timestamps
2
+
3
+ import numpy as np
4
+ import pyarrow as pa
6
5
  import torch
6
+ from dora import Node
7
+ from silero_vad import get_speech_timestamps, load_silero_vad
7
8
 
8
9
  model = load_silero_vad()
9
- MIN_SILENCE_DURATION_MS = int(os.getenv("MIN_SILENCE_DURATION_MS", "200"))
10
- MIN_SPEECH_DURATION_MS = int(os.getenv("MIN_SPEECH_DURATION_MS", "1000"))
10
+ MIN_SILENCE_DURATION_MS = int(os.getenv("MIN_SILENCE_DURATION_MS", "100"))
11
+ MIN_SPEECH_DURATION_MS = int(os.getenv("MIN_SPEECH_DURATION_MS", "300"))
11
12
 
12
13
  MIN_AUDIO_SAMPLING_DURAION_S = int(os.getenv("MAX_AUDIO_DURATION_S", "20"))
13
14
  MAX_AUDIO_DURAION_S = int(os.getenv("MAX_AUDIO_DURATION_S", "75"))
@@ -38,14 +39,12 @@ def main():
38
39
  len(speech_timestamps) > 0
39
40
  and len(last_audios) > MIN_AUDIO_SAMPLING_DURAION_S
40
41
  ):
41
-
42
42
  # Check if the audio is not cut at the end. And only return if there is a long time spent
43
43
  if speech_timestamps[-1]["end"] == len(audio):
44
44
  continue
45
- else:
46
- audio = audio[0 : speech_timestamps[-1]["end"]]
47
- node.send_output("audio", pa.array(audio))
48
- last_audios = [audio[speech_timestamps[-1]["end"] :]]
45
+ audio = audio[0 : speech_timestamps[-1]["end"]]
46
+ node.send_output("audio", pa.array(audio))
47
+ last_audios = [audio[speech_timestamps[-1]["end"] :]]
49
48
 
50
49
  # If there is no sound for too long return the audio
51
50
  elif len(last_audios) > 75:
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.2
2
+ Name: dora-vad
3
+ Version: 0.3.9rc2
4
+ Summary: Dora Node for Text translating using Argostranslate
5
+ Author-email: Haixuan Xavier Tao <tao.xavier@outlook.com>
6
+ License: MIT
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: dora-rs>=0.3.6
10
+ Requires-Dist: numpy<2.0.0
11
+ Requires-Dist: silero-vad>=5.1
12
+
13
+ # Speech Activity Detection(VAD)
14
+
15
+ This is using Silero VAD.
16
+
17
+ It detects beginning and ending of voice activity within a stream of audio and returns the parts that contains activity.
18
+
19
+ There's a maximum amount of voice duration, to avoid having no input for too long.
20
+
21
+ ## Input/Output Specification
22
+
23
+ - inputs:
24
+ - audio: 8kHz or 16kHz sample rate.
25
+ - outputs:
26
+ - audio: Same as input but truncated
27
+
28
+ ## YAML Specification
29
+
30
+ ```yaml
31
+ - id: dora-vad
32
+ description: Voice activity detection. See; <a href='https://github.com/snakers4/silero-vad'>sidero</a>
33
+ build: pip install dora-vad
34
+ path: dora-vad
35
+ inputs:
36
+ audio: dora-microphone/audio
37
+ outputs:
38
+ - audio
39
+ ```
40
+
41
+ ## Reference documentation
42
+
43
+ - dora-sidero
44
+ - github: https://github.com/dora-rs/dora/blob/main/node-hub/dora-vad
45
+ - website: http://dora-rs.ai/docs/nodes/sidero
46
+ - Sidero
47
+ - github https://github.com/snakers4/silero-vad
48
+
49
+ ## Examples
50
+
51
+ - Speech to Text
52
+ - github: https://github.com/dora-rs/dora/blob/main/examples/speech-to-text
53
+ - website: https://dora-rs.ai/docs/examples/stt
54
+
55
+ ## License
56
+
57
+ The code and model weights are released under the MIT License.
@@ -0,0 +1,7 @@
1
+ dora_vad/__init__.py,sha256=HuSK3dnyI9Pb5QAuaKFwQQ3J5SIZnLcKHPJO0norGzc,353
2
+ dora_vad/main.py,sha256=HfdT87XdtlZfoNRfKbWKl-ylVNFoq9t8acfrzB6n3wE,1913
3
+ dora_vad-0.3.9rc2.dist-info/METADATA,sha256=4hwg9fqEWXrHQg4IAeKAlvQPb6-Oaq-HViv8ZPydCVY,1463
4
+ dora_vad-0.3.9rc2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
5
+ dora_vad-0.3.9rc2.dist-info/entry_points.txt,sha256=X82-C0mpNH9bVjwn24mzfoWX5ssrK6W1Ylk1HPDR0ME,48
6
+ dora_vad-0.3.9rc2.dist-info/top_level.txt,sha256=1EUgMajnck6tHR4mFagv_uv-t2A6Cabd2wYtEldKm2Q,9
7
+ dora_vad-0.3.9rc2.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dora-vad = dora_vad.main:main
@@ -0,0 +1 @@
1
+ dora_vad
@@ -1,24 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: dora-vad
3
- Version: 0.3.8
4
- Summary: Dora Node for Text translating using Argostranslate
5
- Author: Haixuan Xavier Tao
6
- Author-email: tao.xavier@outlook.com
7
- Requires-Python: >=3.7,<4.0
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.7
10
- Classifier: Programming Language :: Python :: 3.8
11
- Classifier: Programming Language :: Python :: 3.9
12
- Classifier: Programming Language :: Python :: 3.10
13
- Classifier: Programming Language :: Python :: 3.11
14
- Classifier: Programming Language :: Python :: 3.12
15
- Classifier: Programming Language :: Python :: 3.13
16
- Requires-Dist: dora-rs (>=0.3.6,<0.4.0)
17
- Requires-Dist: numpy (<2.0.0)
18
- Requires-Dist: silero-vad (>=5.1,<6.0)
19
- Description-Content-Type: text/markdown
20
-
21
- # Speech Activity Detection(VAD)
22
-
23
- This is using Silero VAD.
24
-
@@ -1,6 +0,0 @@
1
- dora_vad/__init__.py,sha256=Gy4qL4vCeTyA5HR1Yp3ioL4-ClJyW8oi_38CzMuMsBM,358
2
- dora_vad/main.py,sha256=vCTRvRcn51P9gBznRaFNtdz1rSycQDag66bm9Eficzw,1948
3
- dora_vad-0.3.8.dist-info/METADATA,sha256=FZwAgVoMSzR-2bxlIOK9xVrY_8MRHbzoO-cr12-FTOA,818
4
- dora_vad-0.3.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
5
- dora_vad-0.3.8.dist-info/entry_points.txt,sha256=wr9gBgtZsPnfZYt4HJD6Pf7if_ieGubTZxuEbWbJmQI,47
6
- dora_vad-0.3.8.dist-info/RECORD,,
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- dora-vad=dora_vad.main:main
3
-