Skip to main content

音频分析和处理工具库

Project description

WavX

WavX is a Python library for audio analysis and processing, providing a simple yet powerful API for handling various audio-related tasks.

Features

  • Audio file analysis, including amplitude, loudness, and acoustic parameter measurement
  • Audio processing, including RMS level normalization
  • Modular design, easy to extend
  • Clean and intuitive API interface

Installation

pip install wavx

Quick Start

Analyze audio file amplitude information

import wavx

# Analyze audio file and get amplitude information
amplitude_info = wavx.analysis.amplitude.analyze_amplitude("your_audio_file.wav")

# Print all amplitude information
wavx.analysis.amplitude.print_amplitude_info(amplitude_info)

# Or get specific information
print(f"Peak amplitude: {amplitude_info['peak_amplitude']} dB")
print(f"Total RMS amplitude: {amplitude_info['total_rms_amplitude']} dB")

Normalize audio file to target RMS level

import wavx

# Normalize audio file to -20 dB FS
result = wavx.processing.normalization.normalize_to_target(
    input_file="input.wav",
    output_file="output.wav",
    target_rms_db=-20.0,
    reference_type="square"  # or "sine"
)

# Print normalization information
wavx.processing.normalization.print_normalization_info(result)

Project Structure

wavx/
├── docs/
│   ├── amplitude/
│   │   └── amplitude_analysis.md  # Amplitude analysis documentation
│   └── processing/
│       └── normalization.md       # RMS normalization documentation
├── examples/
│   ├── analyze_audio.py           # Example of audio analysis
│   └── normalize_audio.py         # Example of audio normalization
├── wavx/
│   ├── __init__.py                # Package initialization
│   ├── cli.py                     # Command line interface
│   ├── analysis/
│   │   ├── __init__.py            # Analysis module initialization
│   │   └── amplitude.py           # Amplitude analysis functionality
│   ├── processing/
│   │   ├── __init__.py            # Processing module initialization
│   │   └── normalization.py       # RMS normalization functionality
│   ├── tests/
│   │   ├── __init__.py            # Tests initialization
│   │   ├── test_amplitude.py      # Amplitude analysis tests
│   │   └── test_normalization.py  # Normalization tests
│   └── utils/
│       └── __init__.py            # Utilities module initialization
├── README.md                      # English documentation
├── README_zh.md                   # Chinese documentation
├── requirements.txt               # Project dependencies
└── setup.py                       # Package installation config

Command Line Usage

After installation, you can use WavX from the command line:

# Basic amplitude analysis
wavx amplitude path/to/audio.wav

# With custom parameters
wavx amplitude path/to/audio.wav --window 100 --no-dc

# RMS normalization
wavx normalize input.wav output.wav --target -18.0

# With custom reference signal
wavx normalize input.wav output.wav --reference sine --freq 500

Future Extensions

The modular design allows easy extensions:

  1. More Analysis Functions:

    • Spectrum analysis
    • Harmonic analysis
    • Reverb and spatial analysis
  2. More Audio Processing:

    • Equalization
    • Noise reduction
    • Dynamic range compression
    • Resampling and format conversion
  3. Visualization:

    • Waveform display
    • Spectrogram
    • Loudness/RMS history

Release Notes

  • v0.1.0 (2025-03-20): Initial release with amplitude analysis functionality
  • v0.1.1 (2025-03-20): Added docs directory and bilingual README files
  • v0.1.2 (2025-03-20): Added RMS normalization functionality
  • v0.1.3 (2025-03-20): Added WAVX LOGO display after pip install

Contributing

Contributions to the code, questions, or suggestions are welcome!

License

MIT License

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

wavx-0.1.3.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

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

wavx-0.1.3-py2.py3-none-any.whl (16.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file wavx-0.1.3.tar.gz.

File metadata

  • Download URL: wavx-0.1.3.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wavx-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0b7eef0ae6ddcb84a2162d1fac59ceca13d231c96b2e840362f9bfc0278aaa7f
MD5 75223ff631bb328086d8da7f31cb3202
BLAKE2b-256 8ed02aab9d9b854fd5d0a151bfe840d1a30f506121ad397257b7da2dd6abe688

See more details on using hashes here.

File details

Details for the file wavx-0.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: wavx-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wavx-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bd827acf02c41adb32ad86c4934ff337216917392acafb137d3bfd99a911f895
MD5 b8059342c16b6e7f913e4b546439e3e1
BLAKE2b-256 9a84b881ca5e9e3df009ec14f3ee7ae61b616a78c69bc8b83f334b24fab08de8

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