Add support to Angband v3.0.5 for sound effects under Linux with this patch. NB: requires SDL_mixer library.
Angband v3.0.5 - Sound support via SDL_mixer ============================================ *** SPECIAL NOTICE *** This version of the patch is for application against the Vanilla 'angband-3.0.5' version. Do not apply this patch against Craig Oliver's angband-3.0.5-soundfx version. You can find a patch for Craig's soundfx version on my homepage at:http://people.smartchat.net.au/~caboo/angband/soundfx.html
**********************
This patch adds support to Angband v3.0.5 for playing sound effects
under Linux (it should probably work under any *nix system where
you can compile angband, as long as you have a copy of SDL_mixer
installed, but I've only tested it on Mandrake Linux 8.x/9.x/10.x
and a Debian 3.0 stable / testing hybrid running on a DEC Alpha).
NB: You will likely need autoconf & automake installed to apply this
patch.
INSTALLATION
------------
To install this patch:
1) Extract the angband-3.0.5.tar.gz archive into some directory
2) Extract the patch file (angband-3.0.5-sdl_sound_patch.tgz)
into the same directory. This should have unpacked the following
files:
angband-3.0.5/README.SDL (this file!)
angband-3.0.5/sdl_sound.patch
angband-3.0.5/src/sdl_sound.h
angband-3.0.5/src/sdl_sound.c
3) Apply the patch:
cd angband-3.0.5
patch -p1 < sdl_sound.patch
4) Run ./configure as usual. My usual incantation for configure is:
./configure --with-setgid=games \
--with-libpath=/usr/games/lib/angband \
--bindir=/usr/games \
--with-x
for system-wide installation in /usr/games.
5) Run make - this should detect the changes in configure.in and
force the configure script to be rebuild & re-run.
The new configure script has two additional options:
--disable-sdl_sound
--enable-sound_debug
Sound support is built by default if configure detects the SDL_mixer
library. You can turn this off by using the --disable-sdl_sound
option. Using the --enable-sound_debug option will cause a bunch of
trace messages to be displayed during the game (you shouldn't normally
need this).
SETUP
-----
Sound files are not included in the standard source tarball. You will
need to download the extra files for compiling the Windows version:
ftp://ftp.sunet.se/pub/games/Angband/Windows/ext-win-305.zip
Unzip this file and move the contents of the lib/xtra/sound/* directory to your own lib/xtra/sound directory (you won't need the other files form this archive). Make sure you get the sound.cfg file as well as the *.wav files. PLAYING ------- When angband is recompiled with this patch, you can use the -v option to enable sound effects during the game: angband -g -v -mgcu angband -g -v -mx11 angband -g -v -mxaw angband -g -v -mxpj I have not added sound support to the Gtk version (mostly because I never use it). You can also combine with the bigtile options, eg: angband -g -v -mx11 -- -n 6 -b -g By default, all sound files are loaded from disk and cached in memory when the game starts up. Be warned, this does slow down the game load time (especially if you are also using graphics, and more especially in bigtile mode). You can turn this behaviour off by using a '-c' option (ie. turn off sound file caching): angband -g -v -mx11 -- -n 6 -b -g -c Note the position of -c, it must be included as a display-module specific option. When you use -c, the sound files are loaded from disk and played as required. This may cause some latency between game action and the sound to be played. If you're using a "reasonable" machine, this shouldn't be much of an issue. WISHLIST / TODO --------------- - setup multiple playback channels to reduce possibility of sounds "backing up" (I've not yet had this happen, but it's conceivable); [Update: recent experimentation seems to show that this is a non-issue. No matter how many sound events occur, the mixer keeps on happily mixing them - no lag in sound vs. action has been noted]. - support playing of background music (SDL_mixer supports WAVE, AIFF, RIFF, OGG, and VOC files); - increase the number of sound events (the now-defunct Tk*band versions had support for about 200 individual sound events). BUGS ---- None that I know of, so if you find anything, please let me know asap. I originally wrote this patch in mid-2002 and have been using it ever since, just never got around to releasing it! Aside from that, enjoy! Brendon Oliver, 1 December 2004. <brendon.oliver at gmail dot com>