Long Denoiser API
This document is a DeepHearing Denoiser API document for long media files. The Long Denoiser API allows the user to perform file-based noise reduction. It operates asynchronously and can handle long files that were unable to remove noise from the Short Denoiser API due to processing time.
Getting Started
The Long Denoiser API operates as follows.
- Request media file upload url with API key.
- Upload the file to the media file upload url
- Check the processing status of the uploaded media file
- Download the results via the URL provided upon completion
1. Media File API Request
Request to receive the url to upload the file.
The request allows you to receive an ID to check the status of the file, along with the url to which you want to upload the media file.
However, you must upload media file before the URL expires.
Method | URL |
---|---|
POST | https://apigw.prod.deephearing.com/denoise-async/file |
Header
First, you must add the pre-supplied API key to the header before sending the API request.
header = {
'X-API-KEY': "<API_KEY>"
}
Response
If you send an API request, you can receive the following results.
{
"id": "<Request ID>",
"url": "<Media File Upload URL>",
"expires_at": "<URL expiration time>",
"usageRemain": "<Remaining usage>"
}
2. Upload Media File
You can proceed with the audio noise removal by uploading the file to the url you received in the previous step. Unlike the Short Denoiser API, you need to upload it in the file
format rather than in the formdata
format.
Uploaded files are stored securely through AWS S3 and are automatically deleted after a certain period of time to keep your files secure.
Please refer to the support format for the supported audio files.
- Python
- cURL
import requests
url = "<Url received in step 1>"
payload = "<file contents here>"
headers = {
'Content-Type': 'audio/wave'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
curl --location --request PUT "<Url received in step 1>" --header 'Content-Type: audio/wave' --data <file_path>
Uploading the file should be sent to url received in step 1 as a PUT
request.
3. Check Media File Status
If you send a request with the request ID returned in the previous step as the url parameter, you can check the processing status of the request with that ID.
Method | URL |
---|---|
POST | https://apigw.prod.deephearing.com/denoise-async/status?id=<Request ID> |
{
"id": "<Request ID>",
"status": "<Processing status>",
"expires_at": "<URL expiration time for step 2>"
}
The types in the processing state are as follows.
pending
: media file upload waiting statusprocessing
: media file noise reduction stepsdone
: media file noise reduction complete statusfailed
: media file error
4. Result File
You can receive a response including url when status
goes to done
in step 3.
{
"id": "<Request ID>",
"status": "<Processing status>",
"expires_at": "<URL expiration time for denoised media files>",
"url":" <Denoised media file URL>"
}
When status
becomes done
, the expiration time is the url expiration time of the denoised media file, so you must download the media file before the expiration time.
Support Media format
Type | |
---|---|
.wav | recommended |