mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
Now, trigger_roles, ducking_roles and volume can be divided into several groups by slash. That means each group can be affected by its own volume policy. If we need to apply ducking volume level differently that is triggered from each trigger role(s), this feature would be useful for this purpose. For example, let's assume that tts should take music and video's volume down to 40% whereas voice_recognition should take those and tts's volume down to 20%. In this case, the configuration can be written as below. trigger_roles=tts/voice_recognition ducking_roles=music,video/music,video,tts volume=40%/20% If one of ducking role is affected by more than two trigger roles simultaneously, volume of the ducking role will be applied by method of multiplication. And it works in the same way as before without any slash. Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
61 lines
1.9 KiB
C
61 lines
1.9 KiB
C
/***
|
|
This file is part of PulseAudio.
|
|
|
|
Copyright 2012 Flavio Ceolin <flavio.ceolin@profusion.mobi>
|
|
|
|
PulseAudio is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU Lesser General Public License as published
|
|
by the Free Software Foundation; either version 2.1 of the License,
|
|
or (at your option) any later version.
|
|
|
|
PulseAudio is distributed in the hope that it will be useful, but
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
|
|
***/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
#include <config.h>
|
|
#endif
|
|
|
|
#include <pulsecore/macro.h>
|
|
#include <pulsecore/core.h>
|
|
#include <stream-interaction.h>
|
|
|
|
#include "module-role-ducking-symdef.h"
|
|
|
|
PA_MODULE_AUTHOR("Flavio Ceolin <flavio.ceolin@profusion.mobi>");
|
|
PA_MODULE_DESCRIPTION("Apply a ducking effect based on streams roles");
|
|
PA_MODULE_VERSION(PACKAGE_VERSION);
|
|
PA_MODULE_LOAD_ONCE(true);
|
|
PA_MODULE_USAGE(
|
|
"trigger_roles=<Comma(and slash) separated list of roles which will trigger a ducking. Slash can divide the roles into groups>"
|
|
"ducking_roles=<Comma(and slash) separated list of roles which will be ducked. Slash can divide the roles into groups>"
|
|
"global=<Should we operate globally or only inside the same device?>"
|
|
"volume=<Volume for the attenuated streams. Default: -20dB. If trigger_roles and ducking_roles are separated by slash, use slash for dividing volume group>"
|
|
);
|
|
|
|
static const char* const valid_modargs[] = {
|
|
"trigger_roles",
|
|
"ducking_roles",
|
|
"global",
|
|
"volume",
|
|
NULL
|
|
};
|
|
|
|
int pa__init(pa_module *m) {
|
|
|
|
pa_assert(m);
|
|
|
|
return pa_stream_interaction_init(m, valid_modargs);
|
|
}
|
|
|
|
void pa__done(pa_module *m) {
|
|
|
|
pa_assert(m);
|
|
|
|
pa_stream_interaction_done(m);
|
|
}
|