Remove background noise from an input audio file with optional webhook callback for asynchronous updates.
Endpoint
This endpoint removes noise from an uploaded or linked audio file. A webhook_url
can be provided for asynchronous task status updates.
Sample Output
Listen to a real sample output:
Download Audio
Try it Yourself
Visit the Denoise Endpoint Explorer to try your own text samples.
š” Tip: Set a webhook_url
to receive results automatically when your audio is ready.
Request Parameters
Parameter | Type | Required | Description |
---|
audio_url | String | Optional | The URL of an audio file to clean. Either audio_url or audio_file must be provided. |
audio_file | UploadFile | Optional | Upload the audio file directly. Either audio_url or audio_file must be provided. |
webhook_url | String | Optional | Callback URL for async response. |
š” Note: Either audio_url
or audio_file
must be provided ā one is required.
Sample Request
curl -X POST "https://api.musicgpt.com/api/public/v1/Denoise" \
-H "accept: application/json" \
-H "Authorization: <api_key>" \
-F "audio_url=https://www.youtube.com/watch?v=jGflUbPQfW8" \
-F "webhook_url=http://webhook.musicgpt.com"
import requests
url = "https://api.musicgpt.com/api/public/v1/deecho"
headers = {
"Authorization": "<<<api key>>>"
}
# Option 1: URL
payload = {
"audio_url": "https://youtube.com/example",
"webhook_url": ""
}
response = requests.post(url, headers=headers, data=payload)
print(response.json())
# Option 2: File Upload
# payload = {
# "webhook_url": "https://www.test.requestcatcher.com/test"
# }
# with open("audio.m4a", "rb") as f:
# files = {"audio_file": f}
# response = requests.post(url, headers=headers, data=payload, files=files)
# print(response.json())
š Replace {path_to_your_audio_file}
, api_key
, and webhook_url
before executing.
Sample Response
Success (200 OK)
{
"success":true,
"task_id":"01e88c6d-5006-4ad9-b7c4-80360ca37860",
"conversion_id":"c3f08613-998d-4ef9-80a9-9c05891e5237",
"eta":71,
"credit_estimate":0.48,
"message":"",
"status":"IN_QUEUE"
}
Webhook Response
Success (200 OK)
{
"success": true,
"conversion_type": "Denoise",
"task_id": "01e88c6d-5006-4ad9-b7c4-80360ca37860",
"conversion_id": "c3f08613-998d-4ef9-80a9-9c05891e5237",
"audio_path": "files/2e7c373c-aef9-4dda-8e70-2ff50ad18169.wav",
"no_noise": "https://lalals.s3.amazonaws.com/conversions/01e88c6d-5006-4ad9-b7c4-80360ca37860_nonoise.mp3",
"no_noise_wav": "https://lalals.s3.amazonaws.com/conversions/01e88c6d-5006-4ad9-b7c4-80360ca37860_nonoise.wav",
"noise": "https://lalals.s3.amazonaws.com/conversions/01e88c6d-5006-4ad9-b7c4-80360ca37860_noise.mp3",
"noise_wav": "https://lalals.s3.amazonaws.com/conversions/01e88c6d-5006-4ad9-b7c4-80360ca37860_noise.wav",
"message": "de_noising conversion Completed",
"conversion_duration": 136.82721088435375,
"conversion_cost": "0.48"
}
Common Errors
- 422 Unprocessable Entity: Both
audio_url
and audio_file
cannot be None
.
- 500 Internal Server Error: A server error occurred during processing.
Successfully initiated noise removal
The response is of type object
.