Angband with sound support for Linux

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


This version of the patch is for application against Craig Oliver's
'angband-3.0.5-soundfx' version which you can find at:
Do not apply this patch against the Vanilla angband-3.0.5 tarball.
You can find a separate patch for Vanilla angband on my homepage at
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 

To install this patch:

1) Extract the archive into some directory
2) Extract the patch file (angband-3.0.5-soundfx-sdl_sound_patch.tgz)
   into the same directory.  This should have unpacked the following
	angband-3.0.5-soundfx/README.SDL (this file!)
3) Apply the patch:
	cd angband-3.0.5-soundfx
	patch -p1 < sdl_sound.patch
4) Run ./configure as usual. NB: You may need to make the configure
   script executable first - my copy was rw only.  If so, then just:
   	chmod 755 ./configure 
   and you should be set.  My usual incantation for configure is:
	./configure --with-setgid=games \
		    --with-libpath=/usr/games/lib/angband \
		    --bindir=/usr/games \
   for system-wide installation.
5) Run make - this should detect the changes in and
   force the configure script to be rebuild & re-run.

The new configure script has two additional options:

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).

Sound files are not included in either the source archive, nor my
patch file.  Craig has some suggestions for obtaining sounds on his
webpage at

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.

- 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).

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>