Re: Replacing esd with gstreamer

On 3/29/06, Adam Williamson <awilliamson mandriva com> wrote:
> To throw in a random user perspective, it would be nice if any
> replacement daemon were somewhat less hardwired into the system than ESD
> is, for the benefit of those of us who have intentionally silent desktop
> environments (I like my music player app to make sounds, and just about
> nothing else...)

My plan right now is to extend the gnome_sound API with the minimum
functionality needed so that other applications don't need to use esd.

Right now, a bunch of gnome programs use esd library because the
gnome_sound interface is not complete for loading and playing samples.
 This includes the sound events. At least in gnome CVS, the programs
which use gnome_sound_connection_get() only use the following esd
functions.  Some also use gnome_sound_connection_get to determine if
the sound works.

esd_sample_getid(int esd, const char* sample_name)
esd_sample_free(int esd, int sample)
esd_sample_play(int esd, int sample)

The simplest API is adding the following functions:

gnome_sound_sample_getid(const char* sample_name)
gnome_sound_sample_free(int sample)
gnome_sound_sample_play(int sample)

 I was planning to have gnome_sound_connection_get() continue to
return the esd handle.  Except that other implementations will return
-1 which will cause unmodified programs and programs which use the
handle for other esd functions to not play anything as if sound was
disabled or the esd connection couldn't be made.

There are definitely better APIs, including one I worked up that uses
the sample names and hides the sample_ids.  But this one is the most
straightforward replacement of the esd functions. My intention is not
to create a new event sound API but to have a fully compatible API
which encapsulates esd and allows it to be replaced with a different

A better sound event API  is definitely needed but the existing one
must be maintained for compatibility. My feeling is that programs
which need anything other than playing sounds for events should use
gstreamer or other media frameworks directly.

 - Ian

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