ESP-Audio-Effects Component
Note
This document is automatically translated using AI. Please excuse any detailed errors. The official English version is still in progress.
Overview
ESP-Audio-Effects is a powerful and flexible audio processing library, designed to provide developers with efficient audio effect processing capabilities. This component is widely used in various smart audio devices, including smart speakers, headphones, audio playback devices, and voice interaction systems.
Features
Automatic Level Control: Automatically adjusts input gain to stabilize audio volume. Progressive adjustment ensures smooth transitions. Dynamic correction of excessive amplification to avoid clipping distortion.
Equalizer: Provides fine control over filter type, frequency, gain, and Q factor. Suitable for audio tuning and professional signal shaping.
Fade In/Out: Implements fade in and fade out effects, ensuring smooth transitions between tracks.
Speed and Pitch Processing: Supports real-time speed and pitch modification, achieving more dynamic playback effects.
Mixer: Merges multiple input streams into one output, with start/target weights and transition times configurable for each input.
Data Interleaver: Handles interleaving and deinterleaving of audio data buffers.
Sample Rate Conversion: Performs sample rate conversion between multiples of 4000 and 11025.
Channel Conversion: Remaps audio channel layout using a weight array.
Bit Depth Conversion: Supports conversion between U8, S16, S24, and S32 bit depths.
Dynamic Range Control: Adjusts the dynamic range of the audio signal according to different playback environments and devices. The dynamic range represents the difference between the quietest and loudest parts of the audio signal.
Multi-band Dynamic Range Compression: Splits the audio signal into multiple frequency ranges using a bandpass filter, and processes the dynamic range independently for each range.
The supported sample rates, channel numbers, and sample bit depths for each module can be referred to README.
Data Layout
ESP-Audio-Effects supports both interleaved and deinterleaved audio formats:
Interleaved Format: Use the
esp_ae_xxx_process()API to process this layout. For example:
L0 R0 L1 R1 L2 R2 ...Where L and R represent left and right channel samples respectively.
Deinterleaved Format: Use the
esp_ae_xxx_deintlv_process()API. Each channel is stored in a separate buffer:
L1, L2, L3, ... // Left channel R1, R2, R3, ... // Right channel
API Style
ESP-Audio-Effects provides a consistent and developer-friendly API:
Category |
Function |
Description |
|---|---|---|
Initialization |
|
Creates an audio effect handle. |
Interleaved Processing |
|
Processes interleaved audio data. |
Deinterleaved Processing |
|
Processes deinterleaved audio data. |
Set Parameters |
|
Sets component-specific parameters. |
Get Parameters |
|
Gets current parameters. |
Release |
|
Release resources and destroy the handle. |