Playing a sound in GNOME



I've been asked to play a sound when the battery is critically low [1]
and also when suspend fails and the lid is closed [2]. The latter is
very important, as some laptops (including macbooks) can actually *melt*
if the lid is closed and they are still running. (!)

So, what is the best way to do this? I really don't want to build in the
whole of the gstreamer stack[3] just to play "alert.wav" at volume "90"
once in the lifetime of the session.

Also, using something like

gst-launch filesrc location=error.wav ! wavparse ! osssink

Will probably break on some systems (OSS vs ALSA) and seems very hacky
to me. I'm guessing we're not counting on ESD being around anymore,
although I could be wrong.

Some users (imagine working in a library) won't want *any* noise in any
circumstance and some users will want the volume all the way up.

At the moment I'm erring on an out-of-process gnome-power-sound
executable that we just send it an argument to play a sound, so as to
keep gstreamer out of process. But this seems very much a hack.

I'm guessing this is very much a gnome-wide problem, hence the mail to
d-d-l.

Better ideas (or screaming insanities) welcome.

Thanks.

Richard Hughes.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=365700
[2] http://bugzilla.gnome.org/show_bug.cgi?id=346542
[3]
http://svn.sourceforge.net/viewvc/gaim/trunk/gtk/gtksound.c?revision=17204&view=markup#l_389




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