Delete READ.md
Browse files
README.md
DELETED
|
@@ -1,101 +0,0 @@
|
|
| 1 |
-
# Audio Preprocessor GUI
|
| 2 |
-
|
| 3 |
-
An interactive Gradio-based GUI tool for preprocessing audio files with options for resampling, loudness normalization, silence trimming, panning correction, segmentation, visualization, and export in various formats.
|
| 4 |
-
|
| 5 |
-
## Features
|
| 6 |
-
|
| 7 |
-
- **Multi-format Support**: Accepts `.wav`, `.mp3`, `.flac`, `.aiff`, `.ogg`, `.m4a` files.
|
| 8 |
-
- **Input Methods**: Upload files, provide a folder path, or import from a Google Drive shared folder.
|
| 9 |
-
- **Preprocessing Options**:
|
| 10 |
-
- Loudness normalization (LUFS and peak-based)
|
| 11 |
-
- Silence trimming from start and end
|
| 12 |
-
- Stereo panning correction
|
| 13 |
-
- Sample rate conversion
|
| 14 |
-
- Bit depth adjustment
|
| 15 |
-
- Mono/stereo channel conversion
|
| 16 |
-
- **Segmentation**: Slice long audio into equal segments by time.
|
| 17 |
-
- **Visualization**: Plot original and processed waveforms with zoomed-in silence trimming views.
|
| 18 |
-
- **Batch Processing**: Supports multi-threaded processing of entire folders or ZIP archives.
|
| 19 |
-
- **Export Formats**: `.wav`, `.mp3`, `.flac`, `.aiff` with configurable bit depth and bitrate.
|
| 20 |
-
- **Output as ZIP**: Bundle processed audio into a downloadable ZIP archive.
|
| 21 |
-
- **CUDA Acceleration**: Automatically uses GPU if available (via PyTorch).
|
| 22 |
-
|
| 23 |
-
## Dependencies
|
| 24 |
-
|
| 25 |
-
- Python ≥ 3.7
|
| 26 |
-
- `numpy`
|
| 27 |
-
- `librosa`
|
| 28 |
-
- `matplotlib`
|
| 29 |
-
- `soundfile`
|
| 30 |
-
- `torch`
|
| 31 |
-
- `pyloudnorm`
|
| 32 |
-
- `gradio`
|
| 33 |
-
- `gdown`
|
| 34 |
-
- `resampy`
|
| 35 |
-
- `ffmpeg` (system-level dependency)
|
| 36 |
-
|
| 37 |
-
> Missing Python packages (`resampy`, `gdown`) are auto-installed at runtime if not present.
|
| 38 |
-
|
| 39 |
-
## Installation
|
| 40 |
-
|
| 41 |
-
```bash
|
| 42 |
-
git clone https://github.com/your-repo/audio-preprocessor-gui.git
|
| 43 |
-
cd audio-preprocessor-gui
|
| 44 |
-
python3 -m venv venv
|
| 45 |
-
source venv/bin/activate
|
| 46 |
-
pip install -r requirements.txt
|
| 47 |
-
# Ensure ffmpeg is installed and in your PATH
|
| 48 |
-
```
|
| 49 |
-
|
| 50 |
-
## Usage
|
| 51 |
-
|
| 52 |
-
```bash
|
| 53 |
-
python app.py
|
| 54 |
-
```
|
| 55 |
-
|
| 56 |
-
1. Open the printed local URL in your browser (e.g. `http://127.0.0.1:7860`).
|
| 57 |
-
|
| 58 |
-
2. Choose an Input Method:
|
| 59 |
-
- **Upload**: Drag-and-drop or browse multiple audio files.
|
| 60 |
-
- **Path**: Enter a filesystem path to a directory, single file, or ZIP.
|
| 61 |
-
- **Google Drive URL**: Paste a shareable folder link (`https://drive.google.com/drive/folders/...`).
|
| 62 |
-
|
| 63 |
-
3. Configure Output Settings:
|
| 64 |
-
- **Format**: `wav` | `mp3` | `flac` | `aiff`
|
| 65 |
-
- **Sample Rate**: `16000Hz` | `44100Hz` | `48000Hz`
|
| 66 |
-
- **Bit Depth**: `16` | `24` | `32` (FLAC 32-bit falls back to 24-bit)
|
| 67 |
-
- **Channels**: `mono` | `stereo`
|
| 68 |
-
- **MP3 Bitrate** (if MP3): `128k` | `192k` | `256k` | `320k`
|
| 69 |
-
|
| 70 |
-
4. Expand Processing Options:
|
| 71 |
-
- **Normalization Profile**: `No Normalization` | `Spotify` (–14 LUFS, –1 dB) | `Apple Music` (–16 LUFS, –1 dB)
|
| 72 |
-
- **Panning Correction**: Yes / No
|
| 73 |
-
- **Show Visualizations**: Toggle waveform & silence‐zoom plots
|
| 74 |
-
- **Enable Segmentation**: Split into fixed‐length chunks
|
| 75 |
-
- *Duration*: slider + time unit (`ms` / `s` / `min` / `h`)
|
| 76 |
-
- **Save outputs as ZIP**: Yes / No + optional ZIP name
|
| 77 |
-
|
| 78 |
-
5. Click **Process Audio** and view:
|
| 79 |
-
- **Logs**: Detailed processing trace
|
| 80 |
-
- **Visualizations**: Waveform & silence‐zoom gallery
|
| 81 |
-
- **Output Files**: Download processed audio or ZIP
|
| 82 |
-
- **Audio Player**: Play processed files in-browser
|
| 83 |
-
|
| 84 |
-
## Code Structure
|
| 85 |
-
|
| 86 |
-
- `Config` dataclass holds global settings (sample rate, bit depth, LUFS targets, etc.).
|
| 87 |
-
- Pre-flight checks auto-install missing Python deps and verify `ffmpeg`.
|
| 88 |
-
- Helper functions for loudness measurement/normalization, panning correction, clipping detection, silence trimming, and plotting.
|
| 89 |
-
- `process_file` executes the pipeline per file, logs each step, generates plots, and exports.
|
| 90 |
-
- Gradio UI (`gr.Blocks`) organizes inputs, settings, and result tabs (Logs, Visualizations, Files, Player).
|
| 91 |
-
- Concurrency via `ThreadPoolExecutor` for batch speed.
|
| 92 |
-
|
| 93 |
-
## License
|
| 94 |
-
|
| 95 |
-
MIT License
|
| 96 |
-
|
| 97 |
-
---
|
| 98 |
-
|
| 99 |
-
Happy audio processing!
|
| 100 |
-
|
| 101 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|