Skip to content

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

labo-ai-audio-tools

Practical AI audio utilities for dataset preparation and lightweight audio processing workflows, with both CLI tools and Python APIs.


Features (MVP)

CLI Tools

  • trim — cut a WAV file by time range
  • stats — compute duration and RMS for a WAV file
  • batch-stats — compute statistics for all WAV files in a directory

Python API

  • trim_wav(...)
  • audio_stats(...)

Project Structure

  • examples/ — runnable example scripts
  • tests/ — unit tests for core functionality and CLI

Quick Start

# Create virtual environment (optional but recommended)
python -m venv .venv
source .venv/bin/activate

# Install package with development dependencies
pip install -e ".[dev]"

# Show CLI help
python -m labo_ai_audio_tools --help

CLI Usage

Generate example audio:

python examples/generate_sine.py

Trim a WAV file:

python -m labo_ai_audio_tools trim \
  examples/sine_1khz.wav \
  --start 0.0 \
  --end 1.0 \
  -o examples/sine_1khz_trimmed.wav

Compute basic audio statistics:

python -m labo_ai_audio_tools stats examples/sine_1khz.wav

Compute statistics for all WAV files in a directory:

python -m labo_ai_audio_tools batch-stats examples/assets --outdir examples/out

Batch Statistics

The batch-stats command scans all .wav files directly under the input directory and computes:

  • duration_seconds
  • rms

The results are exported to:

  • summary.csv
  • summary.json

Example command:

python -m labo_ai_audio_tools batch-stats examples/assets --outdir examples/out

CSV format:

filename,duration_seconds,rms

Python API Example

from labo_ai_audio_tools import trim_wav, audio_stats

trim_wav("input.wav", "output.wav", start_sec=0.0, end_sec=1.0)

stats = audio_stats("output.wav")
print(stats)

Examples

Run the included demos:

python examples/demo_trim.py
python examples/demo_stats.py
python examples/demo_batch_stats.py

Batch Stats Demo

Example output:

filename,duration_seconds,rms
tone_a.wav,0.5,0.3535
tone_b.wav,1.0,0.1767

Development

Install development dependencies:

pip install -e ".[dev]"

Run linting:

ruff check .

Run type checking:

mypy labo_ai_audio_tools

Run tests:

pytest

Roadmap

Short term

  • Add batch dataset preprocessing CLI
  • Add SNR and peak-level statistics

Mid term

  • Add simple denoise and enhancement baselines
  • Add dataset visualization tools

Long term

  • Add dataset preparation pipelines for ML workflows
  • Add optional backend support for additional audio formats

License

Apache License 2.0. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages