This Python library reduces substantial background noise
in audio files containing speech. It uses a machine
learning model (38m parameters) trained to handle
different types of ambient noise.
Installation
pip install audio-denoiser
In Windows, you need the soundfile audio backend:
pip install soundfile
In Linux, both the soundfile and sox audio backends should be supported. Note that the library is trained with the soundfile backend.
Usage
Basic:
from audio_denoiser.AudioDenoiser import AudioDenoiser
denoiser = AudioDenoiser()
in_audio_file = '/content/input-audio-with-noise.wav'
out_audio_file = '/content/output-denoised-audio.wav'
denoiser.process_audio_file(in_audio_file, out_audio_file)
With additional options:
from audio_denoiser.AudioDenoiser import AudioDenoiser
import torch
import torchaudio
# Use a CUDA device for inference if available
device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu')
denoiser = AudioDenoiser(device=device)
in_audio_file = '/content/input-audio-with-noise.wav'
out_audio_file = '/content/output-denoised-audio.wav'
auto_scale = True # Recommended for low-volume input audio
denoiser.process_audio_file(in_audio_file, out_audio_file, auto_scale=auto_scale)
You can also provide your own waveform tensor:
from audio_denoiser.AudioDenoiser import AudioDenoiser
noisy_waveform, sample_rate = torchaudio.load('/content/input-audio-with-noise.wav')
denoiser = AudioDenoiser()
denoised_waveform = denoiser.process_waveform(noisy_waveform, sample_rate, auto_scale=False)
print('Tensor shape: ', denoised_waveform.shape)
Metadata
Release files for audio-denoiser 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| audio_denoiser-0.1.2.tar.gz | 8.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| audio_denoiser-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.1 kB
Release files / audio_denoiser-0.1.2.tar.gz
| Download URL | audio_denoiser-0.1.2.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79c9232f577b9ee50ac1366128226ad34c5a85e0afd3d1a093a87daff530e222
|
|
BLAKE2b-256 checksum How to use checksums |
40b4d742a925527a7ba965c7836a1a47a4423f13a8de176ff217bb11bdd8df88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Release files / audio_denoiser-0.1.2-py3-none-any.whl
| Download URL | audio_denoiser-0.1.2-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81bbda6c065fdd516485b9bba54875bc6e5b82e08ed4d3c80d3d8353e84a3bd5
|
|
BLAKE2b-256 checksum How to use checksums |
8cbf39832aa96433ac99816aed1a904797b78d551f163ac9cd202037bd9f0dde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|