Next: , Previous: gnome-program, Up: Top


5 gnome-sound

Sound playing routines.

5.1 Overview

This module provides wrapper functions for playing sound samples. Currently it just wraps the esound daemon, but the API is flexible enough that other sound infrastructures can be included in the future.

These functions also allow for the fact that no sound may be supported on the current platform. So applications can safely call these functions to play sounds and they will just quietly return if no action is possible.

5.2 Usage

— Function: gnome-sound-init (hostname mchars)

Initialize the esd connection.

hostname
Hostname where esd daemon resides.
— Function: gnome-sound-shutdown

Shuts down the gnome sound support.

— Function: gnome-sound-play (filename mchars)

Plays the audio stored in filename, if possible. Fail quietly if playing is not possible (due to missing sound support or for other reasons).

filename
File containing the sound sample.
— Function: gnome-sound-sample-load (sample_name mchars) (filename mchars) ⇒  (ret int)

Loads the audio from filename and load it into the esd cache for later playing. Programs will rarely want to call this function directly. Use gnome-sound-play instead for fire and forget sound playing.

sample-name
The name of the sample.
filename
The filename where the audio is stored.
ret
The esound sample_id or ‘-1’ if the sample was unable to be cached for esound.