What is SoundSense?

SoundSense is a sound-engine tool for Dwarf Fortress. It plays sounds based on what entries appear in the gamelog.txt. There is a thread at the official dwarf fortress forums, feel free to post your ideas and contributions there. You can also check out wiki page for know issues and other documentation.

Tantrum spiral, in style! part 2, part 3


Requires java 1.6 runtime. Install by unzipping to the Dwarf Fortress directory. For alternate location, you can edit soundSenseExe.cmd and change second to last parameter. Run by running soundSenseExe.cmd.

SoundSense r2016-1 1006.93 kB, 13.03.2016 Soundpack 315.82 MB, 13.03.2016

Remember to add official sound pack (separate download) or to run automated update after instalation!

Older versions: http://df.zweistein.cz/soundsense/
  • release 2015/1 (0.9 MB)
  • release 2014/1 (0.7 MB)
  • release 42 (0.7 MB)
  • release 41 (0.7 MB)
  • release 40 (0.7 MB)
  • release 39 (0.7 MB)
  • release 38 (0.7 MB)
  • release 37 (0.7 MB)
  • release 36 (0.7 MB)
  • release 35 (0.7 MB)
  • release 34 (0.7 MB)
  • ...
  • release 28 (0.5 MB)
  • ...
  • release 23 (9.2 MB)

  • Instalation

    Instalation and setting it up can be intimidating task if you are not an IT nerd, but bear with us, it can actually be easy (and fun).

    Non-scary instructions:
    • Install java runtime
    • Download and extract soundsense, does not matter where.
    • Download soundpack to packs directory in soundsense directory.
    • Run soundsense.cmd or soundsense.exe

    First, you need to have java runtime installed. It can be downloaded from java homepage. To see that you have correct instalation, go to Start->Run, type cmd in dialog that opens, press ok. You are now at commandline, type java -version. If everythig is okay, few lines starting with something similar to java version "1.6.0_14-ea" should apear, in that case you are cool to go.

    If something similar to 'java' is not recognized as an internal or external command appears, you do not have properly set up instalation and can either fix it or work around it by editing soundSense.cmd which is in root of archive. Open it in Notepad and find line line starting with java -Dja... and replace java with full path for java instalation and java itself, for example "C:\Program Files\Java\jdk1.6.0_20\bin\java.exe".

    So, hard issues are now handled :).

    Now, where to install it? SoundSense expects to be in directory that is inside your DF folder, so for example if you have DF in f:/df_31_12_win_s/, you should unpack contents of SoundSense zip to f:/df_31_12_win_s/soundSense. Basically, so that gamelog.txt is one directory above .cmd file you use to launch application.

    If you want to install in different location, you need to edit configuration.xml and edit path="../gamelog.txt", replace ../gamelog.txt with path to wherever it is located (for example with f:/df_31_12_win_s/gamelog.txt).

    It is now all set up and ready to run, but you need some sounds that it will actually play: Download soundpack.zip and unzip it to directory packs.

    Now you can run SoundSense by launching soundSense.cmd or soundSenseExe.cmd (which should give you more sensible error messages regarding bad java instalation).

    And there was much rejoicing!

    Sound Packs:

    Install them by unzipping them to packs directory of the SoundSense.

    "Official soundpack" Credits for help for to tyrspawn and Rainseeker :). Music from following sources was also used:

    Official soundpack is work in progress, you can check out our status on tracking page.

    • ¤toikkus.zip¤ (1.3 MB, last update 9.7.2010), Pack of announcements voiced by Toikkus from forums
    • ¤toikkus2.zip¤ (2.3 MB, last update 29.1.2011), Seccond pack of announcements voiced by Toikkus
    Ah, welcome to our new home!


    Helpfull stuff:
    • packSkeletons.zip are xml files for all known log lines without sounds, you can use this as your starting point.
    • missingMessages.cmd will parse log file and output all lines your packs will not recognize
    • Edit logging.properties to enable more debug messages from SS, set .level = ALL to view very verbose output.

    Add sound by adding entry to xml configuration file. logPattern="regexp" is a regular expression which if matched, will cause random soundFile from sound element to be played.

    sound element attributes:
    • logPattern - regular expression matching log line.
    • channel - string, channel on which sound is played. Sounds played on channel can be looped/stopped prematurely.
    • loop - string, "start" - sound start loop on channel until different sound is played on channel (if it is non-looped sound, loop will resume when it is done playing) or sound with "stop" is triggered.
    • concurency - number, number of councured sounds allowd to be played besides this sound. If currenty playing more than that, sound is ignored. In miliseconds, default unlimited.
    • timeout - number, timeout during which is sound going to be prevented from playing again. In miliseconds default 0.
    • propability - percentage, Propablity that sound will be played. Default is always played.
    • delay - number, delay before sound is played. In miliseconds, default 0.
    • haltOnMatch - boolean, if set to true, sound sense will stop processing long line after it was matched to this sound. Default false
    • ansiFormat - ANSI escape code, used to color console output.
    soundFile element attributes:
    • fileName - path to audio file with sound.
    • weight - number, controls likelihood of sound to be chosen. Defaulkt is 100.
    • volumeAdjustment - number, adjusts volume of sample. Can range from -40 to +6 decibles, default 0.
    • randomBalance - boolean, if set to true will randomply distribute sound betweem stereo channels.
    • balanceAdjustment - number, adjusts stereo channel, can range for -1 (full left) to 1 (full right).
    sounds element attributes:
    • defaultAnsiColor - ANSI escape code, used to color console output when nothing is defined at sounds.

    Sound can contain several soundFile elements, when it is triggered one random of them is triggered. You can control how often is particular sound chosen by weight="number" attribute.

    Supported formats for soundFiles:
    • mp3
    • ogg
    • wav
    • aiff
    • au

    soundFile itself can be playlist instead of sound file itself, marked by playlist="true" attribute. Sound files in playlist inherit all properties of their soundfile parent.

    Supported formats for playlist:
    • pls
    • m3u

    Modding resources

    Excellent utility mp3gain can help with keeping volume of sounds matching.

    Ansi Codes Visual guide to ansi codes.

    Source Code

    Open source can be found at google code, within soundsense distribution itself and here: soundSense_2016-1_196_source.zip.

    Grand plan

    Current development goals are to expand list of known events which we can react to and add apropriate sounds.