Google
 

Phonon

Phonon is the cross platform multimedia API for KDE 4. Phonon was created as a solution to several problems commonly faced by unix desktops for multimedia. Phonon itself is not a multimedia framework, but interfaces with existing frameworks such as GStreamer or Xine via backends. Phonon allows all multimedia frameworks it supports to be accessed through a simple API. This prevents problems like frameworks becoming unmaintained, API instability, and KDE depending on a single framework. Phonon is not limited to unix and backends are being developed to support Windows and Mac OS X by Trolltech.

For example, a file can be played in only a few lines of C++ code, an order of magnitude less than required using the old audio framework (aRts).

MediaObject *media = new MediaObject(this);
media->setCurrentSource("/home/username/music/filename.ogg");
media->play();


Phonon reduces redundant and difficult work done by developers, while not having every conceivable multimedia feature it does provide a simple way to perform common functions of media players. Though some developers may require more control over a backend than Phonon can provide.


Features

* Phonon interfaces with various backends with what developers call "engines"; each engine works with one specific backend. Each backend lets Phonon control basic functions like play, pause, and seek. Phonon will also support higher level functions such as how tracks fade into each other.
o Supported backends on Unix-like systems as of 23 April 2008 include xine, Gstreamer, VLC and MPlayer;
o Supported backends under Windows include DirectX, VLC and MPlayer ;
o Supported backends under Mac OS X include Quicktime ;

* Phonon is able to switch multimedia frameworks on the fly. The user is able to switch between frameworks even while listening to music, with only a slight pause during the switch. This change is also system wide, affecting all applications that use Phonon, so changing frameworks will be much easier.

* Using Solid, Phonon will give the users greater control over accessories like headsets, speakers, and microphones. An example was given that you could have a VoIP conversation only be played through your headset, but have all other sounds come out through speakers. Phonon also gives developers much easier access to multimedia hardware like webcams, which Phonon will be able to record from by the release of KDE 4.1.

Trolltech

Trolltech uses Phonon in its Qt 4.4 release to provide cross platform audio/video playback.

All text is available under the terms of the GNU Free Documentation License.