Skip to main content

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


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.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

audio_denoiser-0.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file audio-denoiser-0.1.0.tar.gz.

File metadata

  • Download URL: audio-denoiser-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for audio-denoiser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 39144371b7edd31f6c977117d68b1f6c7dbdf10e06ff3f060d050b9b1d7e4aa2
MD5 336463c47a9d6d63e4c8ca68f58991ea
BLAKE2b-256 9e284163f6be702618cf03551b05df99cd66a78eafedbe65e5989629f6359a93

See more details on using hashes here.

File details

Details for the file audio_denoiser-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for audio_denoiser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae012f49d913e068cc7639bc0fbb7673634b5341cb83072912f95f2403d7e4fb
MD5 63c59161744a9bf5a404c5a2d88703d8
BLAKE2b-256 4f12af756d08860ba92211a519581328adbe914d9ea321073df0630b5fe92f80

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page