Update Getting Started
+75
-3
@@ -1,6 +1,6 @@
|
||||
# Getting Started
|
||||
|
||||
## Prerequisites
|
||||
## Run from source
|
||||
|
||||
- **Python 3.8 or higher**
|
||||
- **FFmpeg** - required for audio processing
|
||||
@@ -15,6 +15,14 @@
|
||||
|
||||
---
|
||||
|
||||
### Clone and run
|
||||
|
||||
```bash
|
||||
git clone https://git.vmn.su/max/audio_splitter.git
|
||||
cd audio_splitter
|
||||
python -m audio_splitter.main input.mp3 tracklist.txt
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
### From Source
|
||||
@@ -23,21 +31,85 @@
|
||||
git clone https://git.vmn.su/max/audio_splitter.git
|
||||
cd audio_splitter
|
||||
pip install .
|
||||
audio_splitter input.mp3 tracklist.txt
|
||||
```
|
||||
|
||||
### Using Docker
|
||||
You can also pull a pre-build OCI image from the registry
|
||||
|
||||
CLI version:
|
||||
**CLI version:**
|
||||
```bash
|
||||
docker pull git.vmn.su/max/audio_splitter:latest
|
||||
mkdir /tmp/audio_splitter_test
|
||||
cd /tmp/audio_splitter_test
|
||||
docker run --rm -v $(pwd):/data git.vmn.su/max/audio_splitter:latest -o /data /data/test.mp3 /data/tracklist.txt
|
||||
```
|
||||
Web API only:
|
||||
|
||||
Put your audio and track list files to '/tmp/audio_splitter_test' before running the container. **Ensure the directory you mount as /data is empty**
|
||||
|
||||
**Web API only:**
|
||||
```bash
|
||||
docker pull git.vmn.su/max/audio_splitter_backend:latest
|
||||
docker container run -d -p 8000:8000 git.vmn.su/max/audio_splitter_backend:latest
|
||||
curl -X POST -F "file=@./q.opus" http://localhost:8000/api/upload
|
||||
# Response: {"task_id":"dca75691","filename":"q.opus","size":4010709}
|
||||
# We need to copy task_id
|
||||
curl -X POST http://localhost:8000/api/split \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"task_id": "YOUR_TASK_ID",
|
||||
"tracklist": [
|
||||
{"ts": "00:00", "tn": "Intro"},
|
||||
{"ts": "01:30", "tn": "Song One", "an": "Artist A"},
|
||||
{"ts": "02:20", "tn": "Another Song", "an": "Artist B"}
|
||||
],
|
||||
"options": {
|
||||
"format": "mp3"
|
||||
}
|
||||
}'
|
||||
# Response: {"task_id":"YOUR_TASK_ID","status":"processing"}
|
||||
curl http://localhost:8000/api/status/YOUR_TASK_ID
|
||||
# Response {"task_id":"YOUR_TASK_ID","status":"done","progress":100,"message":"Split complete","error":null,"tracks":[....]}
|
||||
# Now you can download the result
|
||||
curl -OJ http://localhost:8000/api/download/YOUR_TASK_ID
|
||||
```
|
||||
|
||||
Complete web-interface:
|
||||
```bash
|
||||
# Pull and start the backend
|
||||
docker pull git.vmn.su/max/audio_splitter_backend:latest
|
||||
docker container run -d -p 8000:8000 git.vmn.su/max/audio_splitter_backend:latest
|
||||
|
||||
# Pull and start the frontend
|
||||
docker pull git.vmn.su/max/audio_splitter_frontend:latest
|
||||
docker run -d -p 5173:80 git.vmn.su/max/audio_splitter_frontend:latest
|
||||
```
|
||||
Now the fully functional web-interface should be accessible via http://localhost:5173
|
||||
|
||||
|
||||
### Using Docker Compose
|
||||
Web version is also available with Docker Compose:
|
||||
|
||||
```compose
|
||||
services:
|
||||
backend:
|
||||
image: git.vmn.su/max/audio_splitter_backend:latest
|
||||
ports:
|
||||
- "${BACKEND_PORT:-8000}:8000"
|
||||
volumes:
|
||||
# Bind mount for persistent data storage.
|
||||
# Set BACKEND_DATA_DIR in .env to point to your data directory.
|
||||
- "${BACKEND_DATA_DIR:-/var/lib/audio_splitter_data}:/tmp/audio_splitter_web"
|
||||
environment:
|
||||
- PYTHONUNBUFFERED=1
|
||||
- DEBUG=${DEBUG:-0}
|
||||
restart: unless-stopped
|
||||
|
||||
frontend:
|
||||
image: git.vmn.su/max/audio_splitter_frontend:latest
|
||||
ports:
|
||||
- "${FRONTEND_PORT:-5173}:80"
|
||||
depends_on:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
```
|
||||
Reference in New Issue
Block a user