Skip to main content

AEC(Acoustic Echo Cancellation) Audio Processing Module

Project description

AEC Audio Processing Module

A Python module for real-time audio processing using WebRTC technology, optimized and maintained by TheDeveloper. This package provides an easy-to-use interface for audio processing capabilities including echo cancellation, noise suppression, and automatic gain control.

Features

  • Acoustic Echo Cancellation (AEC): Removes echo from audio streams
  • Noise Suppression (NS): Reduces background noise
  • Automatic Gain Control (AGC): Automatically adjusts audio levels

Requirements

  • swig
  • meson
  • compile toolchain
  • python3

Installation

You can install the package directly from PyPI:

pip install aec-audio-processing

Basic Usage

Simple Audio Processing

from aec_audio_processing  import AudioProcessor

# Initialize with all features enabled
ap = AudioProcessor(enable_aec=True, enable_ns=True, enable_agc=True)
ap.set_stream_format(16000, 1)      # 16kHz mono

# Process 10ms of audio data
audio_10ms = b'\0' * 160 * 2        # 10ms, 16000 sample rate, 16 bits, 1 channel
audio_out = ap.process_stream(audio_10ms)

# Check if voice was detected
if ap.has_voice():
    print("Voice detected!")

Configuration Options

from aec_audio_processing  import AudioProcessor

# Initialize with specific features
ap = AudioProcessor(
    enable_aec=True,    # Echo cancellation
    enable_ns=True,     # Noise suppression  
    enable_agc=True,    # Automatic gain control
    enable_vad=True     # Voice activity detection
)

# Set audio format
ap.set_stream_format(
    sample_rate_in=16000,      # Input sample rate (Hz)
    channel_count_in=1,        # Input channels
    sample_rate_out=16000,     # Output sample rate (Hz) 
    channel_count_out=1        # Output channels
)

# Set reverse stream for echo cancellation
ap.set_reverse_stream_format(16000, 1)

# Set stream delay for echo cancellation
ap.set_stream_delay(50)  # 50ms delay


# Check feature status
print(f"AEC enabled: {ap.aec_enabled()}")
print(f"NS enabled: {ap.ns_enabled()}")
print(f"AGC enabled: {ap.agc_enabled()}")

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

aec_audio_processing_fork-1.0.1.dev1.tar.gz (5.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

aec_audio_processing_fork-1.0.1.dev1-cp313-cp313-win_amd64.whl (921.0 kB view details)

Uploaded CPython 3.13Windows x86-64

aec_audio_processing_fork-1.0.1.dev1-cp312-cp312-win_amd64.whl (921.0 kB view details)

Uploaded CPython 3.12Windows x86-64

aec_audio_processing_fork-1.0.1.dev1-cp311-cp311-win_amd64.whl (920.8 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file aec_audio_processing_fork-1.0.1.dev1.tar.gz.

File metadata

File hashes

Hashes for aec_audio_processing_fork-1.0.1.dev1.tar.gz
Algorithm Hash digest
SHA256 c325db5c791f32c643b97d7a81c8f4757c4cb6e19d4d70520a287ae405ad8e69
MD5 01227f5728ddfe0dc342599f7072a1a7
BLAKE2b-256 2d79efb7d0bf80385a22d54f2acf23134594cfb8d8bb7ef4f8618690e616c89f

See more details on using hashes here.

File details

Details for the file aec_audio_processing_fork-1.0.1.dev1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for aec_audio_processing_fork-1.0.1.dev1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f6ce0843862df881815b633e9a636d58c0e5e7af22c6bffd2d9680153eeab149
MD5 8c417380038138df69660106c690a683
BLAKE2b-256 10f2cc892c25546c1ad6c02d2fd7ef82f3a008dfee59f616a30c757c9a416778

See more details on using hashes here.

File details

Details for the file aec_audio_processing_fork-1.0.1.dev1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for aec_audio_processing_fork-1.0.1.dev1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a15b25f576482319d7355606f0a0f7c8a6e1e4c07f53b0c1d6d54dee0fad3625
MD5 ee3f2312e50b9e4460001df2797a0a40
BLAKE2b-256 8de51e2a94110a9c26504227bc6e0ead6584d455a9a6de00d0e0e35d557e24da

See more details on using hashes here.

File details

Details for the file aec_audio_processing_fork-1.0.1.dev1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for aec_audio_processing_fork-1.0.1.dev1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6ac62200100d6dd02621d24e3308d2a8942cacc7e81998265f51bdf9726439e9
MD5 6d1454d0ab5a0541f99fb0e1dcf1179b
BLAKE2b-256 1bfde1f31437a9131efdfbba8258fdc6a2ddfe2b0f5a28ec0873b6c2342532cb

See more details on using hashes here.

Supported by

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