Spleeter Web is a web application for isolating or removing the vocal, accompaniment, bass, and/or drum components of any song. For example, you can use it to isolate the vocals of a track, or remove the vocals to get an instrumental version of a song.
It is powered by Spleeter, the awesome source separation library from Deezer. Specifically, it uses the pretrained 4stems-model
model, which performs audio separation very well.
The app uses Django for the backend API, React for the frontend, PostgreSQL for the database, and Huey+Redis for the task queue.
- 4 GB+ of memory (source separation is memory-intensive)
- Docker and Docker Compose
-
Build and start containers using the development Docker config:
> docker-compose -f docker-compose.yml -f docker-compose.build.yml -f docker-compose.dev.yml up --build
-
Launch Spleeter Web
Navigate to http://0.0.0.0:8000 in your browser.
- 4 GB+ of memory (source separation is memory-intensive)
- Python 3.6 or 3.7
- Node.JS 12
- Redis
- PostgreSQL
- ffmpeg
-
Configure PostgreSQL and Redis
In
django_react/settings_dev.py
, updateDATABASES['default']
to point to your PostgreSQL database.By default, it assumes you have a database called
spleeter-web
running onlocalhost:5432
with the userspleeter-web
and no password.Next, ensure Redis is running on
localhost:6379
. -
Install Python dependencies
> python3 -m venv env > source env/bin/activate > pip3 install -r requirements.txt
-
Install Node dependencies
> cd frontend > npm install
-
Start backend and frontend servers (from project directory):
Set
DJANGO_DEVELOPMENT
to use development setting overrides. By default it will use production values.> export DJANGO_DEVELOPMENT=true > npm run dev --prefix frontend & python manage.py runserver 0.0.0.0:8000
-
In a separate session, start Huey worker (Redis should be running):
> export DJANGO_DEVELOPMENT=true > export HUEY_WORKERS=1 > source env/bin/activate > python manage.py run_huey
-
Launch Spleeter Web
Navigate to http://0.0.0.0:8000 in your browser.
By default, Spleeter Web uses the local filesystem to store uploads and separated songs. It supports many other storage backends like Azure Storage or S3 using django-storages.
You can edit django_react/settings_docker.py
(if using Docker) or django_react/settings_dev.py
and set DEFAULT_FILE_STORAGE
to another backend like 'storages.backends.azure_storage.AzureStorage'
.
If using Docker, create an .env
file in the project root directory with the django-storages parameters corresponding to your cloud provider.
Example of .env
using Azure Storage:
AZURE_ACCOUNT_KEY=<key>
AZURE_ACCOUNT_NAME=<account name>
...
If not using Docker, set the above values as environment variables.
Spleeter Web can be deployed on VMs such as Azure VMs, AWS EC2, DigitalOcean, etc. Deploying to cloud container services like ECS is not yet supported out of the box.
-
Clone this git repo
> git clone https://github.com/JeffreyCA/spleeter-web.git > cd spleeter-web
-
In
spleeter-web
, create an.env
file with production environment variables.env
file:APP_HOST=<spleeter-web.com> AZURE_ACCOUNT_KEY=<account key> AZURE_ACCOUNT_NAME=<account name> HUEY_WORKERS=<num workers>
-
Build and start prebuilt production containers
The following pulls prebuilt Docker images from Docker Hub:
> sudo docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
Alternatively, you can build the Docker images from source.
> sudo docker-compose -f docker-compose.yml -f docker-compose.build.yml -f docker-compose.prod.yml up --build -d