Skip to main content

Lightweight package to validate/measure audio files in local or S3 directories.

Project description

Usage

1. Install

pip install dvtk

2. Run

Run dvtk to validate audio files in local directories.

dvtk \
  --paths /path/to/directory/ \
  --ext .wav \
  --metrics dvtk.default_metrics:sr,duration,max_amplitude,dnsmos_speech \
  --output dv_result.csv \
  --parallel \
  --max-workers 8

Run dvtk to validate audio files in S3 directories.

dvtk \
  --paths s3://bucket-name/path/to/directory/ \
  --ext .wav \
  --metrics dvtk.default_metrics:sr,duration,max_amplitude,dnsmos_speech \
  --output dv_result.csv \
  --parallel \
  --max-workers 8

Remarks

  • You can specify multiple paths and extensions (e.g., --ext .wav .flac).
  • You can specify the AWS profile to use (--aws-profile).
  • More default metrics are available in dvtk.default_metrics (e.g., reference-free PESQ, reference-free SI-SDR for speech).

Using Custom Metrics

  1. Create a small python module (e.g., mymetrics.py) in your working directory:
# mymetrics.py
import numpy as np

def custom_metric(audio: np.ndarray, sr: int) -> float:
    ...  # compute the custom metric
    return metric  # float
  1. Run the CLI:
dvtk \
  --paths /path/to/directory/ \
  --ext .wav \
  --metrics dvtk.default_metrics:duration,max_amplitude,dnsmos_speech \
            mymetrics:custom_metric \
  --output dv_result.csv \
  --parallel \
  --max-workers 8

TODOs

  • Support more storage backends (e.g., Google Cloud Storage)
  • On-disk caching or cehckpointing
  • Progress bar

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

dvtk-0.2.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

dvtk-0.2.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file dvtk-0.2.0.tar.gz.

File metadata

  • Download URL: dvtk-0.2.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for dvtk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 195dd91b9188f7442d119420dda246fc0d5aec94198eefee5a4fdc254309e79c
MD5 f56c5564f51da6422bcbc880e420a1f1
BLAKE2b-256 adc3e03da783f27c6349a2509d8cf77982244bf0378bad215b3027a255ccc61b

See more details on using hashes here.

File details

Details for the file dvtk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dvtk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for dvtk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05b91223a1c2ef7035baf4870a905b5af293a766617dc87cd51be1e8bb1cb455
MD5 55695b1498e76f08cd15d60c12044100
BLAKE2b-256 998d9f570296adb1d8156c873aae7457ad2a132affe42f1c9a15d616299b2314

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