[pulseaudio-discuss] Pulse Audio Window focus app

Colin Guthrie gmane at colin.guthr.ie
Fri Jan 30 01:45:29 PST 2009


'Twas brillig, and Jason Taylor at 30/01/09 00:12 did gyre and gimble:
> Hi.
> 
> I've written a small python app that monitors the window focus and 
> current pulseaudio streams and fades volume levels based on window focus 
> and active streams.. this allows banshee to mute on skype calls... video 
> players to mute music players etc...
> 
> Basically like 
> http://workouts.foss.in/2008/index.php/Implementing_volume-follows-focus_in_PulseAudio#Report
> 
> * *its pretty much just a toy experimenting with how it would work... 
> (and I use skype for work so muting the music automaticlly was my main 
> itch to scratch)
> 
> Code is in bzr at https://launchpad.net/eyecandy/0.2
> 
>  - I divided apps up into a couple of classes (music,video,voice) and 
> created some rules around that
> 
> - I also got a fade working depending on where the window is on screen 
> left/right fade,

Nice :)

You should consider fiddling around with pulse modules as I'm sure such 
functionality would be appreciated by others too.

Eventually we want to tag each stream with a property that would 
implement these categories as you've done, but sadly as pulse works with 
a lot of other apps via protocols that do not support metadata (e.g. 
OSS/alsa etc) many apps will not set these properties. There fore we 
will have to have some kind of heuristic database to try and tag things 
properly (this should be easy enough with a module and a simple 
database, even if it is a little hick :)).

> - Is there a way to check if a stream is actually producing sound not 
> just active... flash player in ff does not seem to play nice??

This particular issue is a bug with flash as far as I can tell.

I'm not sure if the API tells you if a stream is paused or muted or not, 
but like I say I suspect it wouldn't help in the FF case anyway.

Perhaps someone more knowledgeable will be able to give better info ;)

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
   Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
   Mandriva Linux Contributor [http://www.mandriva.com/]
   PulseAudio Hacker [http://www.pulseaudio.org/]
   Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list