Phonon Sample Cache

Trever Fischer tdfischer at fedoraproject.org
Fri Aug 26 17:37:23 BST 2011


Howdy, all.

As we discussed forever ago back in lovely Randa, Switzerland, Phonon was
going to get a sample cache for rapid playback of tiny sound files. This
is needed because phonon really isn't designed to do that.

I've come up with a preliminary UML diagram to illustrate what I think
might work: http://i.imgur.com/4VIEr.png

The delay between calling play() and the speakers making some noise must
be as low as possible. Eventually, the latency should be low enough that
even games can rely on low-latency audio to Just Work.

A quick discussion with Colin suggests to me that some further design
refinement is needed. To illustrate, everything should be handled with
libcanberra on Linux because reinventing the wheel sucks. That raises one
minor problem: using libcanberra on linux, we'd only need the correct
sample name, such as "new-message-im". For other desktops, we would need
the path to the sound or at least a place to look for the sound.

One more note: This is in no way intended to replace KNotify or to create
a cross-desktop notification system. The primary intent is for something
such as the meego dialer to quickly play a DTMF tone the instant the
keypad button is pressed, or KGoldRunner to not be laggy and cut off the
sounds. libcanberra supports game sounds to be themed, so playing nice
with that is the reason for sound theme support.

A possible solution to this is to make the MRL arguments optional and
implement our own naive theme search algorithm that uses a supplied
directory to find samples.

Personally, I think theming game sounds is silly and would hardly ever be
used; I'm looking for input from those who disagree with me because I
don't think I'd be able to make a solution that satisfies that audience.

-- 
Trever Fischer (tdfischer)
Fedora Ambassador, KDE Hacker
http://wm161.net
GPG: C40F2998 hkp://wwwkeys.pgp.net



More information about the kde-multimedia mailing list