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
  • v0.1.4 (2025-03-21): Added spectrogram analysis and visualization

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.4.tar.gz (34.6 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.4-py2.py3-none-any.whl (19.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: wavx-0.1.4.tar.gz
  • Upload date:
  • Size: 34.6 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.4.tar.gz
Algorithm Hash digest
SHA256 5ae26907f32b93e84baa145fba0d3be13c6a70f8bd1a70d256fc249c371bec08
MD5 b349b6e0162d8e2c15df47d912dff5f7
BLAKE2b-256 01e9648c78089beb26805c0b2b38c499d8a3a0242460dc9ad509856d6fa2fdff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wavx-0.1.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 19.0 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.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eec1ce7c95eea8e73e36d9dbae2b675d5d35aa41ae974d0949069fc826c0b74e
MD5 65020403fc57f55bf891883df57fe96c
BLAKE2b-256 b10147c0a92722f8bb729097231e5cf7c5770e9247a97c943d997326b6ae75ce

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