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 4

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 4

Remarks

  • You can specify multiple paths and extensions (e.g., --ext .wav .flac).
  • You can specify the AWS region to use (--region-name).
  • 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 4

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.1.0.tar.gz (10.2 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.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dvtk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e65876161a11cc5f130f09092d5322d77d85ff3297895b9319aa87a9f834c5d
MD5 6201fc6d7347cd736092299d0229b1bf
BLAKE2b-256 880c500b9b40ada40dfef7370cf2deaaafd73fec5fd42bd1c37a276930fd0010

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dvtk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5b621fe2fb5d774f8816ba5d5d61126f35c169e917501c60ba823aec5e5c07d
MD5 1ea7eb10870644d2cc4ba83cb0569791
BLAKE2b-256 67728e0aa875b429b226a7a032a18d04d4a8c040cab23c3eaedaaba334859efe

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