Skip to main content

Short Denoiser API

This documentation is for the DeepHearing Short Denoiser API.

Request

The Denoiser API allows users to perform file-based denoising.

MethodURL
POSThttps://apigw.prod.deephearing.com/denoise

Only one file can be processed per request. Also, file processing is done synchronously and you receive the results after the audio is processed.

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

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

Body

When POST an audio file to the API with a filename, you get a denoised audio file back.

Body
formdata.append("audio", fileInput.files[0]);
caution

When adding an audio file to the form-data, the key should be set to "audio".

Supports

The following file extensions are supported

TypeDescription
.wavthis is the default setting of API.recommend
.mp3When processing MP3 files, you need to specify the encoding type as a query.
info

Here's how it works for MP3 files.

Example
var audioFile = fileInput.files[0];

fetch("https://apigw.staging.deephearing.com/denoise?encoding=mp3",
{
// options...
})
.then(response => {
// other actions...
})
.then(result => console.log(result))
.catch(error => console.error(error));
caution

For wav, API works without adding encoding to the query as this is the default setting, but for mp3, you need to add encoding to the query to use the API.

note

For wav, you can also use the API by adding ?encoding=wav.

Request Sample

curl
curl --location 'https://apigw.staging.deephearing.com/denoise' \
--form 'audio=@"/path/to/file"'
var fileInput = document.querySelector("input[name=audio]")

var headers = new Headers();
headers.append("X-API-KEY", "<API_KEY>");

var formdata = new FormData();
formdata.append("audio", fileInput.files[0]); //formdata key should be set to audio.

var options = {
method: 'POST',
headers,
body: formdata,
};

//In this case, it only works for wav files
fetch("https://apigw.staging.deephearing.com/denoise", options)
.then(response => {
// other actions...
})
.then(result => console.log(result))
.catch(error => console.error(error));

Responses

Success Response

Success
{
"result": "<Base64-encoded audio files>",
"totalBilledTime": "<Total length of the audio file>",
"usageRemain": "<Remaining usage>"
}

Error Response

403
{
message: "Forbidden"
}
413
{
message: "Request Too Long"
}
500
{
message: "Internal server error"
}