A Python library for (speech) audio denoising.
Project description
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
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 the "soundfile" audio backend, used in training.
torchaudio.set_audio_backend("soundfile")
# 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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
audio-denoiser-0.1.1.tar.gz
(8.2 kB
view details)
Built Distribution
File details
Details for the file audio-denoiser-0.1.1.tar.gz
.
File metadata
- Download URL: audio-denoiser-0.1.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8860abe43d40c06098512394c829e6d1c034d355c38b06cc46f02e404dc6de7e |
|
MD5 | 55437d8106ceabbe91daee9b94c94ad6 |
|
BLAKE2b-256 | 77004f0582d1bad55c5d0b0ce246ddfe5547195c39bf81b167ad92d27fac559e |
File details
Details for the file audio_denoiser-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: audio_denoiser-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e5e95e997db077b9ebdaf4a003f574c5a9464fd09c15d5a15f968feda883263 |
|
MD5 | adc2cec639270c5d699d46fb09814724 |
|
BLAKE2b-256 | 8f542d855ff93d0583ca1c6dd436cbccbde8bfa70be6a4bb827a31825bb98c5e |