イコライザ¶
Equalizer
このAPIで提供されるイコライザーは以下をサポートします:
Provided in this API equalizer supports:
- 10バンドの固定数;
  
fixed number of ten (10) bands;
 - 4つのサンプルレート:11025 Hz、22050 Hz、44100 Hz、48000Hz。
  
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 | 
各帯域のデフォルトゲインは-13dBです。 すべての帯域のゲインを設定するには、構造equalizer_cfgを使用します。 個々のバンドのゲインを設定するには、関数equalizer_set_gain_info()を使用します。
Default gain of each band is -13 dB. To set the gains of all bands use structureequalizer_cfg. To set the gain of individual band use functionequalizer_set_gain_info().
アプリケーション例¶
Application Example
このAPIの実装は、audio_processing/equalizerの例で示されています。
Implementation of this API is demonstrated in the audio_processing/equalizer example.
APIリファレンス¶
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: オーディオ要素ハンドルself: Audio element handlerate: オーディオサンプルレートrate: Audio sample ratech: オーディオチャンネルch: 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: オーディオ要素ハンドルself: Audio element handleindex: イコライザーの中心周波数の位置index: the position of center frequencies of equalizervalue_gain:インデックス内のオーディオゲインの値value_gain: the value of audio gain which inindexis_channels_gain_equal: オーディオチャネルの数が2に等しい場合、is_channels_gain_equalをチェックすることにより、2つのチャネルが等しいオーディオゲインの値。is_channels_gain_equalがtrueの場合、それは等しいことを意味し、そうでない場合は等しくないことを意味します。is_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)¶ 受信データをイコライズするAudioElementハンドルを作成します。
Create an Audio Element handle that equalizes incoming data.
- Return
 - 作成されたオーディオ要素ハンドル
  
The created audio element handle
 - Parameters
 config: 構成config: The configuration
構造体¶
Structures
- 
struct 
equalizer_cfg¶ イコライザー構成。
Equalizer Configuration.
Public Members
- 
int 
samplerate¶ オーディオサンプルレート(Hz)
Audio sample rate (in Hz)
- 
int 
channel¶ オーディオチャンネル数(Mono = 1、Dual = 2)
Number of audio channels (Mono=1, Dual=2)
- 
int *
set_gain¶ イコライザーゲイン
Equalizer gain
- 
int 
out_rb_size¶ 出力リングバッファのサイズ
Size of output ring buffer
- 
int 
task_stack¶ タスクスタックサイズ
Task stack size
- 
int 
task_core¶ コアで実行されているタスク…
Task running in core…
- 
int 
task_prio¶ タスクの優先度
Task priority
- 
int 
 
マクロ¶
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.