This real-time echo cancellation implementation using ONNX is unstable, and there is a problem that the voice after echo cancellation sounds distorted. I am not familiar with voice processing, so I am struggling with this. I welcome any suggestions for improvement from those knowledgeable in audio processing.
This repository does not implement a solution to the issue of noise in the audio, but I solved it myself.
A playground for experimenting with acoustic echo cancellation using a microphone, speaker, and ONNX.
- Ubuntu22.04
- Python3.10
sudo apt-get update \
&& sudo apt-get install libsndfile1 python3-dev
pip install \
SoundCard==0.4.3 \
soundfile==0.12.1 \
sounddevice==0.5.0
python aec.py
=== Available audio devices ===
=== Microphones ===
Index 0: Full HD webcam Mono
Index 1: Monitor of USB Microphone Analog Stereo
Index 2: USB Microphone Digital Stereo (IEC958)
Index 3: Monitor of Built-in Audio Digital Stereo (IEC958)
Index 4: Monitor of GA104 High Definition Audio Controller Digital Stereo (HDMI 2)
=== Speakers ===
Index 0: USB Microphone Analog Stereo
Index 1: Built-in Audio Digital Stereo (IEC958)
Index 2: GA104 High Definition Audio Controller Digital Stereo (HDMI 2)
==============================
Usage: aec.py [output_mode] [mic_index] [output_device_index]
output_mode: "wav" (default) or "speaker"
mic_index: Index of the microphone to use (optional, default is the system default microphone)
output_device_index: Index of the speaker used for outputting the echo-cancelled audio
python aec.py wav
ctrl + c
python aec.py speaker 0 1
ctrl + c
python aec.py speaker
ctrl + c
https://github.com/microsoft/onnxruntime/tree/main/js/web#onnx-runtime-web
https://github.com/microsoft/onnxruntime/tree/main/js/web#Operators