Equalizer¶
Provided in this API equalizer supports:
- fixed number of ten (10) bands;
 - four sample rates: 11025 Hz, 22050 Hz, 44100 Hz and 48000 Hz.
 
The center frequencies of bands are shown in table below.
| Band Index | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 
|---|---|---|---|---|---|---|---|---|---|---|
| Frequency | 31 Hz | 62 Hz | 125 Hz | 250 Hz | 500 Hz | 1 kHz | 2 kHz | 4 kHz | 8 kHz | 16 kHz | 
Default gain of each band is -13 dB. To set the gains of all bands use structure equalizer_cfg. To set the gain of individual band use function equalizer_set_gain_info().
Application Example¶
Implementation of this API is demonstrated in the audio_processing/equalizer example.
API Reference¶
Functions¶
- 
esp_err_t 
equalizer_set_info(audio_element_handle_t self, int rate, int ch)¶ Set the audio sample rate and the number of channels to be processed by the equalizer.
- Return
 - ESP_OK ESP_FAIL
 - Parameters
 self: Audio element handlerate: Audio sample ratech: Audio channel
- 
esp_err_t 
equalizer_set_gain_info(audio_element_handle_t self, int index, int value_gain, bool is_channels_gain_equal)¶ Set the audio gain to be processed by the equalizer.
- Return
 - ESP_OK ESP_FAIL
 - Parameters
 self: Audio element handleindex: the position of center frequencies of equalizervalue_gain: the value of audio gain which inindexis_channels_gain_equal: if Number of audio channel is equal 2, the value of audio gains which two channels are equal by checkingis_channels_gain_equal. ifis_channels_gain_equalistrue,it means equal,otherwise unequal.
- 
audio_element_handle_t 
equalizer_init(equalizer_cfg_t *config)¶ Create an Audio Element handle that equalizes incoming data.
- Return
 - The created audio element handle
 - Parameters
 config: The configuration
Macros¶
- 
EQUALIZER_TASK_STACK¶ 
- 
EQUALIZER_TASK_CORE¶ 
- 
EQUALIZER_TASK_PRIO¶ 
- 
EQUALIZER_RINGBUFFER_SIZE¶ 
- 
DEFAULT_EQUALIZER_CONFIG()¶ 
Type Definitions¶
- 
typedef struct equalizer_cfg 
equalizer_cfg_t¶ Equalizer Configuration.