A podcast preprocessing library for aligning, normalizing, and transcribing audio files.
Project description
Waddle ๐ฆ
Waddle is a preprocessor for podcasts, developed specifically for RubberDuck.fm. It streamlines the process of aligning, normalizing, and transcribing podcast audio files from multiple speakers or individual audio files.
Features
- Alignment: Automatically synchronizes the audio files of each speaker to ensure they are perfectly aligned with the reference audio.
- Normalization: Ensures consistent audio quality by normalizing audio levels.
- Remove Noise: Cleans up audio by reducing background noise for clearer output using
DeepFilterNet. - Subtitle Generation: Generates SRT subtitle files for transcription using
whisper.cpp.
Prerequisites
Before using Waddle, ensure the following requirements are installed:
-
Python 3.12 or higher:
- Install Python from python.org.
-
FFmpeg:
- MacOS:
brew install ffmpeg
- Ubuntu/Debian:
sudo apt update sudo apt install ffmpeg
- Windows:
- Download and install FFmpeg from FFmpeg Downloads.
- Ensure FFmpeg is added to your system's PATH.
- MacOS:
-
fmt (A C++ formatting library for compiling
whisper.cpp):- MacOS:
brew install fmt
- For other platforms, follow installation instructions from fmt GitHub repository.
- MacOS:
Installation
-
Clone the repository:
git clone https://github.com/emptymap/waddle.git
-
Youโre ready to use Waddle!
Usage
Prepare Audio Files
- Upload each speaker's audio files in the
audiosdirectory. - Use the naming convention:
ep{N}-{SpeakerName}.[wav|aifc|m4a|mp4].- Example:
ep1-Alice.wav,ep1-Bob.aifc
- Example:
- Include a reference audio file that covers the entire podcast. The reference file name must start with
GMT(e.g., a Zoom recording).
CLI Options
-
single- Process a single audio file:waddle single path/to/audio.wav -o ./output
-o, --output: Output directory (default:./out).-t, --time: Limit output duration (seconds).
-
preprocess- Process multiple audio files:waddle preprocess -d ./audios -r ./reference.wav -o ./output
-d, --directory: Directory containing audio files (default:./).-r, --reference: Reference audio file for alignment.-o, --output: Output directory (default:./out).-t, --time: Limit output duration (seconds).-c, --comp-duration: Duration for alignment comparison (default:10seconds).-nc, --no-convert: Skip conversion to WAV format.
Example Commands
Podcast Preprocessing
-
Basic Processing:
waddle preprocess -
Specify an Audio Directory:
waddle preprocess -d /path/to/audio/files
-
Use a Custom Reference File:
waddle preprocess -r /path/to/GMT-Reference.wav
-
Limit Output Duration:
waddle preprocess -t 30
-
Skip WAV Conversion:
waddle preprocess -nc
Single Audio File Processing
-
Basic Processing:
waddle single /path/to/audio.wav
-
Limit Output Duration:
waddle single /path/to/audio.wav -t 30
Developer Guide
This section provides guidelines for developers contributing to Waddle. It includes setting up the development environment, running tests, and maintaining code quality.
Setting Up the Development Environment
-
Clone the Repository
git clone https://github.com/emptymap/waddle.git cd waddle
-
Install
uv(Recommended) We useuvas a fast package manager.curl -LsSf https://astral.sh/uv/install.sh | sh
Running Tests
We use pytest with coverage analysis to ensure code quality.
-
Run all tests with coverage reporting:
uv run pytest --cov=src --cov-report=html
This will generate a coverage report in
htmlcov/. -
Run a specific test file:
uv run pytest tests/test_example.py
-
Run tests with verbose output:
uv run pytest -v
Linting and Formatting
We use ruff for linting and formatting.
-
Fix linting issues and format code automatically:
uv run ruff check --fix | uv run ruff format
-
Check for linting errors without fixing:
uv run ruff check
-
Format code without running lint checks:
uv run ruff format
Code Structure
The Waddle repository is organized as follows:
waddle/
โโโ pyproject.toml # Project metadata, dependencies, and tool configurations
โโโ src/ # Main library source code
โ โโโ waddle/
โ โ โโโ __main__.py # CLI entry point for Waddle
โ โ โโโ argparse.py # Handles CLI arguments and command parsing
โ โ โโโ config.py # Configuration settings for processing
โ โ โโโ processor.py # Core processing logic for audio preprocessing
โ โ โโโ utils.py # Helper functions for audio handling
โ โ โโโ processing/
โ โ โ โโโ combine.py # Merges multiple audio sources
โ โ โ โโโ segment.py # Segments audio into chunks
โ โ โโโ audios/
โ โ โ โโโ align_offset.py # Synchronization logic for alignment
โ โ โ โโโ call_tools.py # Interfaces with external audio tools
โ โ โโโ utils_test.py # Unit tests for utilities
โ โโโ waddle.egg-info/ # Packaging metadata for distribution
โโโ tests/ # Unit and integration tests
โ โโโ integration_test.py # End-to-end integration tests
โ โโโ ep0/ # Sample audio files for testing
โ โ โโโ GMT20250119-015233_Recording_1280x720.wav # Reference audio
โ โ โโโ ep12-kotaro.wav # Example speaker audio
โ โ โโโ ep12-masa.wav # Example speaker audio
โ โ โโโ ep12-shun.wav # Example speaker audio
โโโ README.md # Documentation for installation and usage
Key Files and Directories:
-
src/waddle/__main__.py- CLI entry point for running Waddle.
-
src/waddle/processor.py- Core logic for aligning, normalizing, and transcribing audio.
-
src/waddle/processing/combine.py- Merges multiple speaker audio files into a single track.
-
src/waddle/processing/segment.py- Splits long audio into manageable segments.
-
src/waddle/audios/align_offset.py- Handles audio synchronization using a reference track.
-
tests/integration_test.py- Runs integration tests to validate the preprocessing pipeline.
Contributing
-
Create a Feature Branch
git checkout -b feature/my-new-feature
-
Write Code & Add Tests
- Ensure all functions are covered with tests in
tests/.
- Ensure all functions are covered with tests in
-
Run Tests & Formatting
uv run pytest uv run ruff check --fix uv run ruff format
-
Commit Changes
git add . git commit -m "Add my new feature"
-
Push and Create a Pull Request
git push origin feature/my-new-feature
- Open a PR on GitHub and request a review.
CI/CD
- GitHub Actions will run:
pytestfor testsruff checkfor lintingruff formatfor formatting- Code coverage report generation
Ensure your changes pass CI before merging!
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
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
File details
Details for the file waddle_ai-0.1.1.tar.gz.
File metadata
- Download URL: waddle_ai-0.1.1.tar.gz
- Upload date:
- Size: 56.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c5cdb24cc598a578874bab48d2601240050c38b1ab441e0aca47ce73aa91ffe
|
|
| MD5 |
35f0c375a6b78bb201c4b35760a1c31f
|
|
| BLAKE2b-256 |
58e480f8edf44d56c1b2275b7331cb9ec832a7d4db37dab7af5f492034b5dec3
|
File details
Details for the file waddle_ai-0.1.1-py3-none-any.whl.
File metadata
- Download URL: waddle_ai-0.1.1-py3-none-any.whl
- Upload date:
- Size: 39.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55d5c80d5494d939739b6837bcb29100e55557a5f798de26143cb8fd97e5c764
|
|
| MD5 |
1b472bffbaeb197df62c114a0cbdb80d
|
|
| BLAKE2b-256 |
1db8a094fd45686a6cabdffde42fde9eb4f8aaa05df9365783e23401713c89c7
|