Skip to main content

No project description provided

Project description

Dguard VAD

Based on Silero VAD and RnNoise.

Installation

pip install dguard_vad==0.1.0

or

git clone http://ai.lyxxkj.com.cn:3001/zhaosheng/dguard_vad.git
cd dguard_vad
pip install -e .

The model files will not be downloaded automatically. You need to download them manually and put them in the right place.(Default: $$DGUARD_MODEL_PATH/dguard_vad.onnx)

$DGUARD_MODEL_PATH is an environment variable that used in all dgurad* projects.

Usage

  1. VAD class
from dguard_vad import VAD
SR = 16000
WAV_PATH = "../data/test_16k.wav"
vad = VAD(SR)
# Use get_speech_timestamps to get 
# start and end timestamps of speech segments
timestamps = vad.get_speech_timestamps(WAV_PATH)
for _ in timestamps:
    print(_)

# You shuold get the following output:
# {'segment': 0, 'start': 26560, 'end': 48704}
# {'segment': 1, 'start': 71616, 'end': 106048}
# {'segment': 2, 'start': 149952, 'end': 185920}

# Use get_speech_probs to get probabilities for each chunk
probs = vad.get_speech_probs(WAV_PATH)
for _ in probs:
    print(_)
# You shuold get the following output:
# 0.02
# 0.01
# 0.01
# 0.01
# 0.0
  1. VAD class with noise suppression You just need to set denoise=True when initializing VAD class.
vad = VAD(SR, denoise=True)

Please note that: func:get_speech_probs may not work well with noise suppression.

  1. VADIterator class Please refer to ws_app/ws_server.py for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dguard_vad-0.1.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dguard_vad-0.1.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file dguard_vad-0.1.1.tar.gz.

File metadata

  • Download URL: dguard_vad-0.1.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.14

File hashes

Hashes for dguard_vad-0.1.1.tar.gz
Algorithm Hash digest
SHA256 437bb97c0aaf3e59feff63de540af236f3991966e365792295ce1ae790a8f97b
MD5 11bc6907994ada472e735699633f168d
BLAKE2b-256 6176973ab1f56550a89e66f362737c40d2c1cb331f1a1c23e6272cc27045cf5d

See more details on using hashes here.

File details

Details for the file dguard_vad-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dguard_vad-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.14

File hashes

Hashes for dguard_vad-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f8933a6dc0a6f386c5fad8715d6c1706256df857e7ecaf0fdad39c97e7f5971e
MD5 6f42e09e3d7ce952448b0971c903c1a8
BLAKE2b-256 b778e514f42875e6efbacb24b100ef1845d190c2634327805caa6ccf234d9f13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page