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 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
- 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
- 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
- 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.1.tar.gz
(10.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
dvtk-0.1.1-py3-none-any.whl
(11.3 kB
view details)
File details
Details for the file dvtk-0.1.1.tar.gz.
File metadata
- Download URL: dvtk-0.1.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
190c491fb1ff48266b7446688a9cdfc2210ecf57e1146963c01e47628bfdb32c
|
|
| MD5 |
6008aa548fdd410a80d73a87e8ac80b5
|
|
| BLAKE2b-256 |
c232c70c471ae4edb1ef48715e74d900224bae91f21590c6d44b2ce1b4cbccb1
|
File details
Details for the file dvtk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dvtk-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40e0e4a40bc61b33a990ff21c9fcc3a9e6faa45a5a060e2846ac8d92353aa6f4
|
|
| MD5 |
3a482e626c5113df68fe873fec0720dc
|
|
| BLAKE2b-256 |
820ef50dec257074cf4994243673ca62fc2351c9a0f3afbf51006e40bf3bfae2
|