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

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)

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

Uploaded Source

Built Distribution

audio_denoiser-0.1.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file audio_denoiser-0.1.2.tar.gz.

File metadata

  • Download URL: audio_denoiser-0.1.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for audio_denoiser-0.1.2.tar.gz
Algorithm Hash digest
SHA256 79c9232f577b9ee50ac1366128226ad34c5a85e0afd3d1a093a87daff530e222
MD5 2fd13e7606d21c5ed23dbbdd8ee072c1
BLAKE2b-256 40b4d742a925527a7ba965c7836a1a47a4423f13a8de176ff217bb11bdd8df88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for audio_denoiser-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81bbda6c065fdd516485b9bba54875bc6e5b82e08ed4d3c80d3d8353e84a3bd5
MD5 a1606e2870e3fab3855a06298fc320ce
BLAKE2b-256 8cbf39832aa96433ac99816aed1a904797b78d551f163ac9cd202037bd9f0dde

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