How to Denoise Audio
If you've recorded audio in a noisy environment, or have some background noise such as a fan on your take, don't panic! It's very easy to denoise your audio with AudioStack.
Denoising audio
In this tutorial we'll work through a constructed example.
You will learn
- How to upload a noisy audio file
- How to use the denoiser functionality
- How to download that file from the API
1. Uploading a file
The first part is to upload a noisy audio file. Select a noisy audio file and add it to the folder.
- For my example I recorded using Quicktime on my mac, and had a noisy office/ background noise (I tapped the table and shook my keys)
file = audiostack.Content.File.create(
FILE_TO_DENOISE,
uploadPath="how-to-guides/sep_audio_example.mp3",
fileType="audio",
)
Tip This is the same as uploading ANY file to our api, we create an object in our file system.
2. Denoising a file
Secondly we will use the Denoiser pipeline
response = audiostack.production.suite.Suite.denoise(fileId=fileId, wait=True)
The key thing is that you get a pipelineId
back. And this is the object you want back from the API. By setting wait=True
our SDK will poll the Audiostack API to check if your file is ready.
Alternatively, you can set wait=False
and poll the API yourself with:
response = audiostack.production.suite.Suite.get(pipelineId=pipelineId)
Then we proceed to step 3
Step 3: Downloading the file
file = audiostack.Content.File.get(fileId=response.newFileIds[0]["fileId"])
file.download(fileName="denoised.wav", path="./")
4. Running an end-to-end example
Get your API key from platform.audiostack.ai and then run:
export AUDIOSTACK_API_KEY=<your API key> && python separate_audio/sep_audio.py
Updated 3 months ago