Skip to content

prixt/soundsense-rs

Repository files navigation

SOUNDSENSE-RS

Soundsense, written in Rust.
Build

My attempt at recreating SoundSense, a sound-engine utility for Dwarf Fortress, using Rust.

Why?

  1. To see if I could do it.
  2. Attempt to create a standalone application that doesn't require bloat.

Current Features

  • Plays sounds reactive to what happens in DF.
  • Can adjust sound volumes realtime, by channel.
  • Skip and pause sound loops, by channel.
  • Supports most sound parameters used by the original Soundsense (stereo balance, random balance, etc.)
  • Custom ignore list, allowing user to customize which log patterns to ignore.
  • Additional soundpack parameters. (Channel Settings)
  • Simple and Clean GUI.
  • Low memory requirement.

Command line arguments

  • -l / --gamelog [GAMELOG_FILE] : preload the gamelog (default: ".\gamelog.txt")
  • -p / --soundpack [PACK_DIR] : preload the soundpack (default: ".\soundpack")
  • -i / --ignore [IGNORE_FILE] : preload the ignore list (default: ".\ignore.txt")
  • --no-config : Don't read config files on start. Will use the given paths, or soundsense-rs defaults.

Example:

soundsense-rs.exe -l "path/to/gamelog.txt" -p "path/to/soundpack/folder"

This will make soundsense-rs check if there is a file named "ignore.txt" in the current working directory, and will use that file to make the ignore list.

Ignore List

Each line in the ignore list file is considered a regex pattern. If a gamelog message matches any of the patterns, that message is ignored.

Example:

(.+) cancels (.+): (.*)(Water|water)(.*)\.

This pattern will make soundsense-rs ignore any cancellations related to water.

The regex pattern uses the regex crate syntax.

Logging

You can set the following environment variables to set the logging parameters. (Disabled on Windows releases)

  • SOUNDSENSE_RS_LOG: set the level of logging. (trace, debug, info, warn, error; default: warn)
  • SOUNDSENSE_RS_LOG_STYLE: set the level of the log style. (always, auto, never; default: auto)

Channel Settings

Read about it here.

Dependencies

Linux: libasound2, libgtk-3, libgdk-3, libwebkit2gtk-4.0, libjavascriptcoregtk-4.0

MIT License

Read it here.

CSS Resources