Add parameter to control increase speed of compressor

This commit is contained in:
Andreas Eversberg 2024-02-08 23:16:23 +01:00
parent 78d73437bb
commit 5e03574cdd
1 changed files with 5 additions and 2 deletions

View File

@ -1194,6 +1194,8 @@ static struct param {
/* maximum amplification (compressor) */
char *max;
/* increase amplification in dB per second (compressor) */
char *increase;
/* call */
char *interface;
@ -1544,6 +1546,7 @@ static void routing_rx_gain(call_t *call, int argc, char *argv[], struct command
/* routing orders us to set levels */
struct param_def param_compress[] = {
{ .n = "max", .s = &param.max, .d = "maximum amplification in dB (default 16)" },
{ .n = "increase", .s = &param.increase, .d = "increase amplification in dB per second (default 16)" },
{ .n = NULL }
};
@ -1558,7 +1561,7 @@ static void routing_tx_compress(call_t *call, int __attribute__((unused)) argc,
parse_params(argc, argv, command_def);
call->tx_compress = 1;
init_sendevolumenregler(&call->tx_compressor, 8000, ABWAERTS_DBS, AUFWAERTS_DBS, MAXIMUM_DB, (param.max) ? -atof(param.max) : MINIMUM_DB, 1.0);
init_sendevolumenregler(&call->tx_compressor, 8000, ABWAERTS_DBS, (param.increase) ? atof(param.increase) : AUFWAERTS_DBS, MAXIMUM_DB, (param.max) ? -atof(param.max) : MINIMUM_DB, 1.0);
}
static void routing_rx_compress(call_t *call, int __attribute__((unused)) argc, char __attribute__((unused)) *argv[], struct command_def __attribute__((unused)) *command_def)
@ -1571,7 +1574,7 @@ static void routing_rx_compress(call_t *call, int __attribute__((unused)) argc,
parse_params(argc, argv, command_def);
call->rx_compress = 1;
init_sendevolumenregler(&call->rx_compressor, 8000, ABWAERTS_DBS, AUFWAERTS_DBS, MAXIMUM_DB, (param.max) ? -atof(param.max) : MINIMUM_DB, 1.0);
init_sendevolumenregler(&call->rx_compressor, 8000, ABWAERTS_DBS, (param.increase) ? atof(param.increase) : AUFWAERTS_DBS, MAXIMUM_DB, (param.max) ? -atof(param.max) : MINIMUM_DB, 1.0);
}
/* routing orders us to call remote end */