Skip to main content

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.

  1. Request media file upload url with API key.
  2. Upload the file to the media file upload url
  3. Check the processing status of the uploaded media file
  4. 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.

MethodURL
POSThttps://apigw.prod.deephearing.com/denoise-async/file

First, you must add the pre-supplied API key to the header before sending the API request.

Header
header = {
'X-API-KEY': "<API_KEY>"
}

Response

If you send an API request, you can receive the following results.

Success
{
"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.

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)
caution

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.

MethodURL
POSThttps://apigw.prod.deephearing.com/denoise-async/status?id=<Request ID>
Success
{
"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 status
  • processing : media file noise reduction steps
  • done : media file noise reduction complete status
  • failed : media file error

4. Result File

You can receive a response including url when status goes to done in step 3.

Success
{
"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
.wavrecommended