From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1a45f6f8d581d9e5f82a578962207d55.axp-list@archive.invalid> X-Archive-Original-Message-ID: <9601081408.AA07840@us1rmc.bb.dec.com> Date: Mon, 8 Jan 96 09:09:58 EST From: Embedded and RealTime Field Application Engineer Subject: Re: Anyone making noise ??? Greetings, I have been puttering around trying to get my Linux system to make noise when windows are created or destroyed. It has been an interesting experience and I thought others might be curious about my efforts. With help I was able to locate a fairly large collection of sun sound files (.au) on the sunsite archive. Note that these files come from the world of SUN, they are not in the linux part of the tree. These files are attractive because they can be sent directly to the /dev/audio device using the cat command. The FvwmAudio module forks a process, passing it a command string (defined with FvwmAudioPlayCmd) and the audio file you specify. The problem with just setting the command string to /bin/cat is that there is no way to redirect the output to /dev/audio after the audio file is appended. While it is a bit of a hack, they way I solved the problem was to create a new version of FvwmAudio. Near the bottom of FvwmAudio.c you will find two lines that do all the work. Here is what they look like: sprintf(buf,"%s %s", audio_play_cmd_line, sound_table[sound]); sprintf(buf,"%s %s/%s", audio_play_cmd_line, audio_play_dir, sound_table[sound]); Here are the lines after I modified them: sprintf(buf,"/bin/cat %s > /dev/audio", sound_table[sound]); sprintf(buf,"/bin/cat %s/%s > /dev/audio",audio_play_dir, sound_table[sound]); Brute force is ugly... but it will work until I get a chance to do it better... To have fvwm automatically start FvwmAudio, add the following line to the .fvwmrc "InitFunction" definition: Module "I" FvwmAudio Then down near the bottom of .fvwmrc add a section to define the FvwmAudio environment variables. Here is one that I have been playing with: ########################## Audio ########################################## # FvwmAudio Configuration *FvwmAudioPlayCmd /bin/cat *FvwmAudioDir /usr/local/lib/sounds # *FvwmAudioDelay 2 *FvwmAudio startup sonar.au *FvwmAudio shutdown sub_dive_horn.au *FvwmAudio add_window boing.au # *FvwmAudio raise_window whoosh.au # *FvwmAudio lower_window return.au *FvwmAudio focus_change clink.au *FvwmAudio destroy_window explosion-1.au *FvwmAudio iconify return.au *FvwmAudio deiconify whoosh.au # *FvwmAudio toggle_paging # *FvwmAudio new_page # *FvwmAudio new_desk # *FvwmAudio configure_window # *FvwmAudio window_name # *FvwmAudio icon_name # *FvwmAudio res_class # *FvwmAudio res_name # *FvwmAudio end_windowlist I hope someone else finds these comments useful.... Bob Segrest