Noise reduction in audio processing involves the removal or reduction of unwanted background noise or interference from an audio signal. You can achieve noise reduction in Python using various libraries and techniques.
The remove_background_noise is a Flask application that reduces noise from an input recording file and returns several reduced noise audio files (wav) from several noise reducing methods
Noisereduce is a noise reduction algorithm in python that reduces noise in a method called "spectral gating" which is a form of Noise Gate. It works by computing a spectrogram of a signal (and optionally a noise signal) and estimating a noise threshold (or gate) for each frequency band of that signal/noise. That threshold is used to compute a mask, which gates noise below the frequency-varying threshold.
In audio processing with the Librosa library in Python, you can reduce noise using spectral centroid-based thresholding. This calculates high and low spectral centroid thresholds, and then applies a noise reduction filter using the pysndfx library based on those thresholds. The result is a denoised version of the input audio, which is saved as a new WAV file.
To perform noise reduction using MFCC (Mel-frequency cepstral coefficients) in Python, you can use the python_speech_features library to extract MFCC features from the audio signal and then apply thresholding to reduce noise.
Sources:
Technologies used
To run this web application on your local machine, follow the steps below:
Before getting started, ensure that you have the following software installed on your machine:
Step-by-step guide on how to install the project and its dependencies.
git clone https://github.com/bosukeme/remove_background_noise.git
SSH
git clone git@github.com:bosukeme/remove_background_noise.git
cd remove_background_noice
Before you start the application, you need to set up an environment variables. Here's how you can do it:
CLOUD_NAME=
API_KEY=
API_SECRET=
Create a file called .env
file at the root folder of the project with the environmental variables above.
You can create your cloudinary key and secret by signing up on https://cloudinary.com/
pip install -r requirements.txt
Once you have installed the dependencies, you can start the web application using
Linux, Windows "WSL" , MAC
gunicorn -c "gunicorn_config.py" "wsgi:app"
Windows "CMD", "POWERSHELL"
python run.py
Once you have installed the dependencies, and your flask app is running, you can run test within the directory
pytest
navigate to the root directory
docker-compose up --build
To stop the containers
docker-compose stop
Access API documentation via Swagger UI using the link below after starting up the application
http://localhost:8001/api/v1.0/remove-noise/doc/
Using the API: Refer to the Swagger API documentation at http://localhost:8001/api/v1.0/remove-noise/doc/ for a detailed list of available endpoints and how to interact with them.
Troubleshooting If you encounter any issues or have questions, please feel free to reach out to us by creating an issue on our GitHub repository: https://github.com/bosukeme/remove_background_noise.git.
This project is licensed under the MIT License.
Contributors names and contact info
Ukeme Wilson