Detach recorder compressors while preserving capture settings
This commit is contained in:
1 parent
20acf975d9
commit
1bd310c859
2 files changed
+10
No files matched your search
@@ -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;
|
||||
|
||||
@@ -23,6 +23,8 @@ typedef struct {
|
||||
} audio_compressor_config_t;
|
||||
|
||||
struct audio_compressor* audio_compressor_create(void);
|
||||
/* Новый пустой compressor с теми же настройками; позволяет передать запись worker без копии PCM. */
|
||||
struct audio_compressor* audio_compressor_clone_config(const struct audio_compressor* source);
|
||||
void audio_compressor_destroy(struct audio_compressor* ac);
|
||||
|
||||
void audio_compressor_configure(struct audio_compressor* ac, const audio_compressor_config_t* cfg);
|
||||
|
||||
Reference in new issue
Block a user