dynamic routing through pulse audio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



'Twas brillig, and Himanshu Chug at 02/06/11 14:29 did gyre and gimble:
> Thanks Colin. got your point here.
> Now similar to music cork over phone, I need to cork the stream with
> role="event" when another stream with role="phone" becomes active.
> (here event can be sms alert etc)  , Do I need to write any new module
> for this? or this can be achieved some how, any pointers can be helpful?

Initially I'd suggest that you could modify cork-music-on-phone to be
more generic (I've a funny feeling I've suggested this to someone before
too), perhaps renaming it to module-auto-cork or something suitably
generic. Then make it configurable which streams to cork and on which
triggers. e.g.

load-module module-auto-cork trigger_roles=phone,event
cork_roles=music,video

The defaults being "phone" for trigger_roles and "music,video" for
cork_roles.

But...

> I need to Play a Beep kind of sound when an "event" stream (say sms)
> came during active "phone" call stream and cork the actual "event"
> (sms tone) stream.
> 
> So there are two requirements now:
> 1. Cork the "event" stream during active "phone" stream.
> 2. Mixing the "phone" stream with new Beep stream.

OK, so now this gets a little more complicated. Ultimately you want to
change the event sound to something else... I think this specifically
requires a more specialised module.

Something that, when it finds an event stream while a phone stream is
active, actually plays a different, (much more subtle and unobtrusive)
sound (perhaps a sample in the sound sample cache?) instead.

I think this in particular is more specialise and thus has to be handled
before the module-auto-cork got it's hands on it.

For that reason, I'd suggest a module-event-suppress module, that works
in the following way:

load-module module-role-suppress suppress_roles="event"
suppression_sound=/path/to/sound.wav

This module would work pretty much like I describe above. On init, it
would load the suppression_sound (if present) into the sample cache and
then suppress any event sounds and instead play the sample cache.

I think this would work pretty well.

Col


-- 

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

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux