dora-vad 0.3.8__tar.gz → 0.3.9__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.
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.2
2
+ Name: dora-vad
3
+ Version: 0.3.9
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,45 @@
1
+ # Speech Activity Detection(VAD)
2
+
3
+ This is using Silero VAD.
4
+
5
+ It detects beginning and ending of voice activity within a stream of audio and returns the parts that contains activity.
6
+
7
+ There's a maximum amount of voice duration, to avoid having no input for too long.
8
+
9
+ ## Input/Output Specification
10
+
11
+ - inputs:
12
+ - audio: 8kHz or 16kHz sample rate.
13
+ - outputs:
14
+ - audio: Same as input but truncated
15
+
16
+ ## YAML Specification
17
+
18
+ ```yaml
19
+ - id: dora-vad
20
+ description: Voice activity detection. See; <a href='https://github.com/snakers4/silero-vad'>sidero</a>
21
+ build: pip install dora-vad
22
+ path: dora-vad
23
+ inputs:
24
+ audio: dora-microphone/audio
25
+ outputs:
26
+ - audio
27
+ ```
28
+
29
+ ## Reference documentation
30
+
31
+ - dora-sidero
32
+ - github: https://github.com/dora-rs/dora/blob/main/node-hub/dora-vad
33
+ - website: http://dora-rs.ai/docs/nodes/sidero
34
+ - Sidero
35
+ - github https://github.com/snakers4/silero-vad
36
+
37
+ ## Examples
38
+
39
+ - Speech to Text
40
+ - github: https://github.com/dora-rs/dora/blob/main/examples/speech-to-text
41
+ - website: https://dora-rs.ai/docs/examples/stt
42
+
43
+ ## License
44
+
45
+ The code and model weights are released under the MIT License.
@@ -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."
@@ -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.9
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,11 @@
1
+ README.md
2
+ pyproject.toml
3
+ dora_vad/__init__.py
4
+ dora_vad/main.py
5
+ dora_vad.egg-info/PKG-INFO
6
+ dora_vad.egg-info/SOURCES.txt
7
+ dora_vad.egg-info/dependency_links.txt
8
+ dora_vad.egg-info/entry_points.txt
9
+ dora_vad.egg-info/requires.txt
10
+ dora_vad.egg-info/top_level.txt
11
+ tests/test_translate.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dora-vad = dora_vad.main:main
@@ -0,0 +1,3 @@
1
+ dora-rs>=0.3.6
2
+ numpy<2.0.0
3
+ silero-vad>=5.1
@@ -0,0 +1 @@
1
+ dora_vad
@@ -0,0 +1,17 @@
1
+ [project]
2
+ name = "dora-vad"
3
+ version = "0.3.9"
4
+ description = "Dora Node for Text translating using Argostranslate"
5
+ authors = [{ name = "Haixuan Xavier Tao", email = "tao.xavier@outlook.com" }]
6
+ license = { text = "MIT" }
7
+ readme = "README.md"
8
+ requires-python = ">=3.8"
9
+
10
+ dependencies = ["dora-rs >= 0.3.6", "numpy < 2.0.0", "silero-vad >= 5.1"]
11
+
12
+
13
+ [dependency-groups]
14
+ dev = ["pytest >=8.1.1", "ruff >=0.9.1"]
15
+
16
+ [project.scripts]
17
+ dora-vad = "dora_vad.main:main"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,9 @@
1
+ import pytest
2
+
3
+
4
+ def test_import_main():
5
+ from dora_vad.main import main
6
+
7
+ # Check that everything is working, and catch dora Runtime Exception as we're not running in a dora dataflow.
8
+ with pytest.raises(RuntimeError):
9
+ main()
dora_vad-0.3.8/PKG-INFO DELETED
@@ -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
-
dora_vad-0.3.8/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Speech Activity Detection(VAD)
2
-
3
- This is using Silero VAD.
@@ -1,26 +0,0 @@
1
- [tool.poetry]
2
- name = "dora-vad"
3
- version = "0.3.8"
4
- description = "Dora Node for Text translating using Argostranslate"
5
- readme = "README.md"
6
- authors = [
7
- "Haixuan Xavier Tao <tao.xavier@outlook.com>",
8
- "Enzo Le Van <dev@enzo-le-van.fr>",
9
- "Félix Huang <felix.huang.net@gmail.com>",
10
- ]
11
-
12
- packages = [{ include = "dora_vad" }]
13
-
14
- [tool.poetry.dependencies]
15
- dora-rs = "^0.3.6"
16
- numpy = "< 2.0.0"
17
- python = "^3.7"
18
- silero-vad = "^5.1"
19
-
20
-
21
- [tool.poetry.scripts]
22
- dora-vad = "dora_vad.main:main"
23
-
24
- [build-system]
25
- requires = ["poetry-core>=1.8.0"]
26
- build-backend = "poetry.core.masonry.api"