After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 368304 - sound effect api
sound effect api
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.10.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-10-31 14:27 UTC by William Jon McCann
Modified: 2008-07-14 23:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description William Jon McCann 2006-10-31 14:27:25 UTC
Couldn't find an existing bug...

Would be really nice to have a simple API for adding sound effects.  There are many scenarios where having an audio cue can be useful rather and just annoying.  If any of the following occur and you aren't looking at the screen then you may benefit from an audio cue:

 * battery power is critical
 * a long running process has just completed (dvd burn etc)
 * a new IM or email
 * a phone call
 * input is required to continue some task

There are various solutions for this outside of GTK+ but they seem to fail in at least the following ways:

 * Don't have standard sounds
 * Don't use the system sounds where applicable (Windows, OS X, etc.)
 * API requires specifying a filename rather than a sound type/name

Some other APIs:

* http://developer.apple.com/technotes/tn2002/tn2102.html
* http://gaim.sourceforge.net/api/sound_8h.html
Comment 1 Bastien Nocera 2007-09-05 23:13:08 UTC
There's 2 parts to this. One is application-triggered sounds (such as new mail, DVD burning finished, low on battery), the other is widget set sounds (pressing a button makes that sound, selecting a menu item makes that sound).

The latter (probably) needs to be overridable by the former (although I can find any decent examples that wouldn't make me cringe).

GTK+ would need widget specific details to implement the widget set sounds. See
initialize_gtk_signal_relay() and initialize_gnome_signal_relay(), and the incredible hacks to know whether a menu item deserves a sound.

A list of stock sounds in MacOS X:
http://homepage.mac.com/mnishikata/objective-c_memo/play_system_sound_systemsou.html
Comment 2 Lennart Poettering 2008-07-14 22:58:58 UTC
I wonder if we may consider this bug closed now that we have libcanberra.
Comment 3 Bastien Nocera 2008-07-14 23:09:43 UTC
Yep, sounds fine by me.