|
|
|
|
@ -43,6 +43,14 @@ struct audio_compressor {
|
|
|
|
|
int dbg_counter; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/* Начальный gain — середина диапазона [0, max_gain] в дБ (геометрическое среднее). */ |
|
|
|
|
struct audio_compressor* audio_compressor_clone_config(const struct audio_compressor* source) { |
|
|
|
|
if (!source) { DEBUG_ERROR(DEBUG_CATEGORY_MEDIA, "compressor: cannot clone NULL configuration"); return NULL; } |
|
|
|
|
struct audio_compressor* copy = audio_compressor_create(); |
|
|
|
|
if (copy) { audio_compressor_configure(copy, &source->cfg); audio_compressor_set_enabled(copy, source->enabled); } |
|
|
|
|
return copy; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Начальный gain — середина диапазона [0, max_gain] в дБ (геометрическое среднее). */ |
|
|
|
|
static float initial_gain(float max_gain) { |
|
|
|
|
return max_gain > 0.0f ? sqrtf(max_gain) : 1.0f; |
|
|
|
|
|