The XFce Sound Manager is both a module and an application that keeps on listening to XFce's events and plays sounds accordinlgy.
1) The main concept
When XFSound is started as a module (ie from XFce or XFwm using the keyword "Module"), it just enters a loop that keeps on listening to the events coming from the Window Manager (XFwm)
Whenever a event occurs, XFSound will execute the user specified command intended to play actually the sound with the sound file corresponding to the event itself.
The user can interact with XFSound using the graphical interface by starting XFSound as a regular X application (ie not as a module).
2) The user interface
Starting XFSound from a command prompt, by typing xfsound, will open the graphical interface :
3) The events
XFwm emits a large variety of events. XFSound covers the user oriented ones.
The last 3 events are not truely XFwm events :
4) The sound command : xfplay
XFce provides its own command to play the sounds. xfplay, as it is called, uses sox to convert the .wav file to raw data sent directly to /dev/dsp
xplay is a shell script that contains the following command
:
sox $1 -t .raw -r 8000 - > /dev/dsp |
This method is quite simple and robust, though sox does not seem to able to convert 16bit wave sound files.
For best results, use 8bit sample at 8000 Hz.
In order to use the internal sound player, you have to use "internal" as play command (this can be performed automatically by pressing the tiny "I" button). The internal player uses less system & CPU resources, but requires raw files as input (not Wav files).
To use the external (default) player, press the button "D".
5) XFsound and other Window Managers
XFwm and other FVwm based Window managers partially share the event scheme. Therefore, XFSound might work with other Window managers such as FVWM, FVWM2, Afterstep, FVWM-95, etc.
6) Starting XFSound automatically
To prevent incompatibility with some kernels, XFSound is not started automatically from within XFwm.
XFSound is started by the reserved functions "InitFunction" and "RestartFunction" in system.xfwmrc.
If you have a customized version of system.xfwmrc (also called sample.xfwmrc
or .xfwmrc), you need to add the following sentences to your system.xfwmrc
configuration file :
AddToFunc "InitFunction"
+ "I" Module xfsound AddToFunc "RestartFunction"
|