Skip to main content

Cross-platform audio analysis toolkit for speech metrics extraction

Project description

Audio Metrics CLI

๐ŸŽ™๏ธ Cross-platform audio analysis toolkit for speech metrics extraction

PyPI version Python 3.8+ License: MIT


๐Ÿš€ Quick Start

Installation

# Install from PyPI (recommended)
pip install audio-metrics-cli

# Or install from source (development)
git clone https://github.com/i-whimsy/audio-metrics-cli.git
cd audio-metrics-cli
pip install -e ".[dev]"

Basic Usage

# Analyze audio file
audio-metrics analyze your_audio.wav --output result.json

# With verbose output
audio-metrics analyze audio.mp3 --verbose --show-progress

# Transcribe only
audio-metrics transcribe audio.m4a -o transcript.txt

# Compare two audio files
audio-metrics compare v1.wav v2.wav

๐Ÿ“ฆ Features

Core Metrics

  • ๐ŸŽต Audio Information: Duration, sample rate, file size
  • ๐Ÿ—ฃ๏ธ Voice Activity Detection: Speech/silence segmentation
  • ๐Ÿ“ Speech-to-Text: Whisper-powered transcription
  • ๐ŸŽผ Prosody Analysis: Pitch, energy, speech rate
  • ๐Ÿ˜Š Emotion Recognition: Emotional state detection (optional)
  • ๐Ÿ”ค Filler Word Detection: "um", "uh", "like" detection

Supported Formats

  • โœ… WAV
  • โœ… MP3
  • โœ… M4A
  • โœ… FLAC
  • โœ… OGG

Cross-Platform

  • โœ… Windows
  • โœ… macOS
  • โœ… Linux

๐Ÿ“– Documentation

Command Line Interface

analyze - Full Analysis

audio-metrics analyze audio.wav [OPTIONS]

Options:
  -o, --output PATH        Output JSON file path
  -c, --config PATH        Configuration file
  -m, --model TEXT         Whisper model (tiny/base/small/medium/large)
  --no-emotion            Skip emotion analysis
  --show-progress         Show progress bars
  -v, --verbose           Verbose output
  --help                  Show this message

transcribe - Speech to Text

audio-metrics transcribe audio.wav [OPTIONS]

Options:
  -o, --output PATH       Output transcript file
  -m, --model TEXT        Whisper model
  --language TEXT         Language code
  --help                  Show this message

compare - Compare Audio Files

audio-metrics compare audio1.wav audio2.wav [OPTIONS]

Options:
  --format TEXT          Output format (text/json/markdown)
  --help                 Show this message

๐Ÿ“Š Output Example

{
  "audio_info": {
    "duration_seconds": 185.2,
    "sample_rate": 44100,
    "file_size_mb": 2.8
  },
  "vad_analysis": {
    "speech_ratio": 0.81,
    "pause_count": 23,
    "avg_pause_duration": 1.1
  },
  "speech_metrics": {
    "words_total": 820,
    "words_per_minute": 266
  },
  "prosody_metrics": {
    "pitch_mean_hz": 145.3,
    "energy_cv": 0.33
  },
  "filler_metrics": {
    "filler_word_count": 18,
    "fillers_per_100_words": 2.2
  }
}

๐Ÿ”ง Configuration

Create a config.json file:

{
  "models": {
    "speech_to_text": {
      "provider": "whisper",
      "model": "base",
      "device": "auto"
    },
    "vad": {
      "provider": "silero",
      "threshold": 0.5
    }
  },
  "audio_analysis": {
    "enable_pitch": true,
    "enable_energy": true,
    "enable_pause": true
  },
  "features": {
    "enable_emotion": true,
    "skip_if_too_long": 3600
  }
}

๐Ÿ’ป Development

Setup Development Environment

# Clone repository
git clone https://github.com/i-whimsy/audio-metrics-cli.git
cd audio-metrics-cli

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

# Run tests
pytest tests/

# Format code
black src/
ruff check src/

Project Structure

audio-metrics-cli/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ audio_metrics/
โ”‚       โ”œโ”€โ”€ cli.py              # CLI entry point
โ”‚       โ”œโ”€โ”€ config.py           # Configuration
โ”‚       โ””โ”€โ”€ modules/            # Core modules
โ”‚           โ”œโ”€โ”€ audio_loader.py
โ”‚           โ”œโ”€โ”€ vad_analyzer.py
โ”‚           โ”œโ”€โ”€ speech_to_text.py
โ”‚           โ”œโ”€โ”€ prosody_analyzer.py
โ”‚           โ”œโ”€โ”€ emotion_analyzer.py
โ”‚           โ”œโ”€โ”€ filler_detector.py
โ”‚           โ”œโ”€โ”€ metrics_builder.py
โ”‚           โ””โ”€โ”€ json_exporter.py
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ examples/
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments


๐Ÿ“ž Support


Built with โค๏ธ by OpenClaw Team

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

audio_metrics_cli-0.2.0.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audio_metrics_cli-0.2.0-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

Details for the file audio_metrics_cli-0.2.0.tar.gz.

File metadata

  • Download URL: audio_metrics_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for audio_metrics_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7d1fba703b9cc955460b98c937ea690138cdbebb4c4fe737dfb16b85040da701
MD5 a34e90858016b7ce433d575eafb105bb
BLAKE2b-256 392098f8ebce8ff565107f39a76468bc7011eb5194e032a029029f148db789ec

See more details on using hashes here.

File details

Details for the file audio_metrics_cli-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for audio_metrics_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2cbb46363057bfb7d5c4ddc15f8c7fc5c965b4badd069e3a0c694d3340eee0b
MD5 b8f6bcce29458b528673059d80155e46
BLAKE2b-256 2ebe52fb9773f539e3dd1dd4ce53b2e9f61e8173a139497fa5c05aa60d5169b9

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