Demucs - API¶
We provide a REST API to programmatically make requests to the service.
The API endpoint is:
The API runs on Google Cloud Run and you can read about our implementation here.
/predict is a
POST endpoint that receives a JSON object in the body.
The endpoint received a base64 encoded versions of a song.
- The JSON body object should have one item called
instanceswhich contains a list of child objects
- The child object should contain one item called
- The value of
b64should be a base64 encoded version of the song.
And example request body would be as follows:
The response will also be JSON object containing 4 base64 encoded mp3 songs in a similar format:
From here is also possible to test the API.
We provide a Postman Collection with a small 3 second mix fragment to test the API. Access it here: Demucs postman collection.
Base64 encode an mp3 file¶
You can easily convert an
.mp3 file to base64 using this command: