Skip to main content

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

Metadata

Release files for dvtk 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dvtk 0.2.1
File Size Uploaded
dvtk-0.2.1.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dvtk 0.2.1
File Interpreter ABI Platform
dvtk-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.2 kB

Release files / dvtk-0.2.1.tar.gz

Download URL dvtk-0.2.1.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3326f4d69233f8e7975824a37ff6fc331a5c05551e2e7392f1e0aa33e9471a62
BLAKE2b-256 checksum
How to use checksums
b99e1d77cf159595cc6f6ebb8c773dbbc10c26387979440867911b94be469a35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / dvtk-0.2.1-py3-none-any.whl

Download URL dvtk-0.2.1-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
835fac4c5dce180eee755578611bbe041c6d131b751e78b3ca267846bf47adcb
BLAKE2b-256 checksum
How to use checksums
322c4fad8e51c9971abc27773d50e043c4acf6f75453083db9f4b2ae1f4e26cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page