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.1.tar.gz (11.0 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.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dvtk-0.2.1.tar.gz
  • Upload date:
  • Size: 11.0 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.1.tar.gz
Algorithm Hash digest
SHA256 3326f4d69233f8e7975824a37ff6fc331a5c05551e2e7392f1e0aa33e9471a62
MD5 cc1269dd6a9166918412710a58e51ddc
BLAKE2b-256 b99e1d77cf159595cc6f6ebb8c773dbbc10c26387979440867911b94be469a35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dvtk-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 835fac4c5dce180eee755578611bbe041c6d131b751e78b3ca267846bf47adcb
MD5 c0e1345a3b8c9e9d4b31012c73994d01
BLAKE2b-256 322c4fad8e51c9971abc27773d50e043c4acf6f75453083db9f4b2ae1f4e26cf

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