[pulseaudio-discuss] [PATCH] role-ducking: Add support for ducking group
Sangchul Lee
sangchul1011 at gmail.com
Thu Mar 24 13:52:34 UTC 2016
2016-03-24 18:51 GMT+09:00 Tanu Kaskinen <tanuk at iki.fi>:
> On Thu, 2016-03-24 at 00:14 +0900, Sangchul Lee wrote:
>> Hi, Tanu
>>
>> I added more explanation of this patch in the commit message as below.
>> (I may update this patch again as upstream codes are changed recently...)
>>
>> Thanks in advance for your review.
>>
>> Best regards,
>> Sangchul Lee
>>
>> 2016-03-23 20:41 GMT+09:00 Tanu Kaskinen <tanuk at iki.fi>:
>> >
>> > Hi, sorry for the long delay.
>> >
>> > On Fri, 2016-02-19 at 22:22 +0900, Sangchul Lee wrote:
>> > >
>> > > 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.
>> > > And it works in the same way as before without any slash.
>> > Please explain in more detail in the commit message why this is useful
>> > and how the groups work. Examples are always good, I'd like to see both
>> > an example use case description, and an example of how you configure
>> > the module to deal with the use case.
>> 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%
>>
>> And it works in the same way as before without any slash.
>
> Thanks, the example was very helpful. The commit message could clarify
> one more thing: what should happen to the music stream volume if both
> tts and voice_recognition streams are present? Are both volumes
> applied, or is only the lower volume (20%) applied?
The former is right as my implementation. In above case, if the
voice_recognition stream is triggered after the tts stream, music
stream's volume is taken down to 8%(0.4*0.2) as well as tts stream's
volume will be 20%.
(but I think this policy could be changed later on to more reasonable..)
Here's a revised commit message. I'll update it to next version of
patch. Thanks again for your feedback.
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.
More information about the pulseaudio-discuss
mailing list