Skip to main content

No project description provided

Project description

Dguard VAD

Based on Silero VAD and RnNoise.

Installation

pip install dguard_vad

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

dguad_vad-0.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

dguad_vad-0.1.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file dguad_vad-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for dguad_vad-0.1.0.tar.gz
Algorithm Hash digest
SHA256 90ef6f6aad1d33da145bd586784aa67befa6217ab314539a8fa381f0659bcc35
MD5 b08c8b3434c058e391a5e738973a8a61
BLAKE2b-256 ec5e2e0c482fca99939a9ed474d3a28e62f753d1c8fc204e00183f38da33dce9

See more details on using hashes here.

File details

Details for the file dguad_vad-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dguad_vad-0.1.0-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 dguad_vad-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68caf4c298c2aa19bb5a7911da60c47dccf5a92e7780d980c008e0f091b17921
MD5 46789105d1470816d57da1afcf1df6d4
BLAKE2b-256 3695cb981a816861b8103eb11825e590f87645fef1d28fd68b0bb4d1ecaecc4e

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