Professional-grade audio processing pipeline built on Telethon & Spotify's Pedalboard.
TarangFX v2 is a complete rewrite focusing on speed, quality, and stackable effects. Unlike the previous version, v2 allows you to chain multiple operations (e.g., "Convert to FLAC" + "Bass Boost" + "Reverb") into a single processing session.
Key Upgrades in v2:
- Engine: Switched from pure FFmpeg to Spotify's Pedalboard for studio-quality effects (VST-like processing).
- Core: Migrated from Pyrogram to Telethon for better async handling and session management.
- Workflow: New "Session" system. Configure everything first, then process once.
- Performance: Redis caching for rate limits and session state.
- Format Conversion:
- Free: MP3, AAC, OGG, OPUS
- Premium: FLAC, WAV, AIFF, ALAC (Lossless)
- Bitrate Control: 128kbps, 192kbps, 256kbps, 320kbps, and Original (Pass-through).
- Sample Rate:
- Free: 22.05kHz, 44.1kHz
- Premium: 48kHz, 96kHz (High-Res)
Powered by Pedalboard, allowing granular control:
- Bass Boost: Frequency-targeted boosting (20Hz - 120Hz).
- Vocal Enhancement: Presets for Male and Female vocals.
- Standard FX: Reverb, Delay, Distortion, Chorus.
- Smart Normalization: Available to all users.
- Async Operations: Non-blocking downloads and uploads.
- Concurrency Control: Limits active operations per user to prevent server overload.
- Privacy: Temp files are isolated by User ID and auto-deleted after processing.
Follow these steps to set up TarangFX on your local machine or server.
Ensure you have the following installed:
- Python 3.10+: Download Here
- Git: Download Here
Open your terminal (Command Prompt/PowerShell on Windows, Terminal on Linux) and run:
git clone https://github.com/PN-Projects/TarangFX.git
cd TarangFXFFmpeg is required for audio format conversion.
- Download the essential build from gyan.dev.
- Extract the
.7zfile (using 7-Zip or WinRAR) to a folder, e.g.,C:\ffmpeg. - Add FFmpeg to your System PATH:
- Search for "Edit the system environment variables".
- Click "Environment Variables".
- Under "System variables", select Path and click Edit.
- Click New and paste the path to the
binfolder inside your extracted ffmpeg folder (e.g.,C:\ffmpeg\bin). - Click OK on all windows.
- Verify by typing
ffmpeg -versionin a new command prompt.
sudo apt update
sudo apt install ffmpeg
ffmpeg -versionYou need a PostgreSQL database to store user data.
- Go to Neon.tech and sign up.
- Create a new project.
- On the dashboard, copy the Connection String (it looks like
postgresql://user:pass@ep-xyz.neon.tech/neondb?sslmode=require). - Save this for your
.envfile later.
- Windows: Download and install PostgreSQL for Windows. During install, set a password for the
postgresuser.- Your URL will be:
postgresql://postgres:YOUR_PASSWORD@localhost:5432/postgres
- Your URL will be:
- Linux:
sudo apt install postgresql postgresql-contrib sudo -u postgres psql # Inside psql shell: ALTER USER postgres PASSWORD 'your_password'; \q
Redis is used for handling user sessions and rate limiting.
- Go to Redis.com and sign up.
- Create a free subscription.
- Copy the Public Endpoint (e.g.,
redis-12345.c1.us-east-1-2.ec2.cloud.redislabs.com:12345). - Copy the Default User Password.
- Your URL format:
redis://default:PASSWORD@ENDPOINT(e.g.,redis://default:password123@redis-12345...:12345).
- Windows: Redis is not officially supported on Windows.
- Alternative: Use Memurai Developer Edition OR run Redis via WSL 2 (Windows Subsystem for Linux).
- Linux:
sudo apt install redis-server sudo systemctl enable redis-server sudo systemctl start redis-server- Your URL:
redis://localhost:6379/0
- Your URL:
Create a file named .env in the root folder and fill in the following details.
- API_ID & API_HASH:
- Log in to my.telegram.org.
- Go to API development tools.
- Create an app (any name works). Copy the
App api_idandApp api_hash.
- BOT_TOKEN:
- Open Telegram and chat with @BotFather.
- Send
/newbot, name your bot, and get the token.
- OWNER_ID:
- Chat with @userinfobot on Telegram.
- Copy the
Id.
# --- Telegram Defaults ---
API_ID=12345678
API_HASH=abcdef1234567890abcdef
BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
OWNER_ID=123456789 (Your Telegram ID)
# --- Database & Cache ---
# neon.tech or local postgres url
DATABASE_URL=postgresql://user:pass@ep-xyz.neon.tech/neondb?sslmode=require
# redis labs or local redis url
REDIS_URL=redis://default:pass@redis-endpoint:port
# --- Limits & Settings ---
TEMP_DIR=./tmp_downloads
MAX_FILE_SIZE_MB=2000
SESSION_TIMEOUT_MINUTES=10- Create Virtual Environment:
python -m venv venv - Activate Environment:
.\venv\Scripts\activate
- Install Dependencies:
pip install -r requirements.txt - Run:
python bot.py
- Create Virtual Environment:
python3 -m venv venv
- Activate Environment:
source venv/bin/activate - Install Dependencies:
pip install -r requirements.txt # If you face issues with pedalboard, ensure you have build tools installed: # sudo apt install build-essential python3-dev
- Run:
python3 bot.py
If you prefer using Docker (easy deployment on VPS):
# docker-compose.yml
version: '3.8'
services:
bot:
build: .
restart: always
env_file: .env
depends_on:
- redis
# Only needed if you want local redis.
# If using Redis Labs, remove this service and the depends_on block above.
redis:
image: redis:alpine
restart: alwaysCommand to run:
docker-compose up -d --buildWe welcome contributions!
- Fork the repository.
- Create a feature branch (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'Add amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request.