Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 7

Author Topic: SoundSense-RS: SoundSense clone, written in Rust  (Read 42986 times)

prixt

  • Bay Watcher
  • has been taken by a fey mood.
    • View Profile
SoundSense-RS: SoundSense clone, written in Rust
« on: September 05, 2019, 05:53:21 am »

SOUNDSENSE-RS

A SoundSense clone, written in Rust


Spoiler: Windows Screenshot (click to show/hide)
Spoiler: Mac Screenshot (click to show/hide)
Spoiler: Linux Screenshot (click to show/hide)

Hello! I am writing a SoundSense alternative in Rust.

Why?
  • To see if I could.
  • To create a standalone application that doesn't require bloat.
Ultimately, you should only need one binary executable, the soundpack folder, and DF.

Current Features
  • Plays sound reactive to what is happening in DF.
  • Sound volumes can be adjusted realtime, based on channel.
  • Custom ignore list, allowing the user to customize which log patterns to ignore.
  • Minimalistic GUI.

Command line parameters
  • -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:
Code: [Select]
soundsense-rs.exe -l "C:\path\to\gamelog.txt" -p "D:\path\to\soundpack\folder"This will make soundsense-rs check if there is a file named "ignore.txt" in the working directory, and will use that file to make the ignore list.

Dependencies
Linux: libasound2, libgtk-3, libgdk-3, libwebkit2gtk-4.0, libjavascriptcregtk-4.0

Known Issues
  • Not all parameters in the soundpacks are implemented. (ex. threshold)

Bug reports and feature requests are welcome!
« Last Edit: February 21, 2020, 07:57:41 am by prixt »
Logged
SOUNDSENSE-RS - SoundSense alternative written in Rust

jecowa

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #1 on: February 05, 2020, 09:05:40 pm »

Looks cool. It would be great to not need Java or mono.
Logged

jecowa

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #2 on: February 06, 2020, 02:12:31 am »

Do you have an icon for this application? Here's what I'm using right now:



Spoiler: Screenshot in-use: (click to show/hide)
Logged

Abadrausar

  • Bay Watcher
  • empowering ideas
    • View Profile
    • ♫♪♀HDFPS♂♪♫
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #3 on: February 08, 2020, 07:42:52 am »

I have liked this utility because it is multi-platform and very lightweight in memory usage, liberating a whole lot of system memory for being usable in Dwarf Fortress where it is badly needed.

ApplicationPlatform LanguageVersionDownload size in MBRuntime required in MB
LinuxOSXWindows
SoundSensejava runtimer2016-111165-80
SoundCensec# CLR1.4.45.275.275.27100
SoundSense-RSRust native or WebAssembler1.3.22.811.912.70

Any possibility of converting this into a WebAssembly application which is supported by the Rust build system apparently.

Milo Christiansen did that with his Rubble modding system for DF, as a way to streamline the deployment and the debugging of the UI of his application over the many OS supported by DFHACK (Windows, Linux, OSX).

Then; only one application wasm package would be usable in all the 3 OS.




« Last Edit: February 14, 2020, 02:41:06 pm by Abadrausar »
Logged
::: Humble Dwarf Fortress Publishing System ♫♪♀HDFPS♂♪♫ Mods Push Published in DFFD are auto updated in local Players Catalog :::

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #4 on: February 08, 2020, 01:57:24 pm »

How does this handle combat sounds coming in too fast to complete? When I tried SoundCense (the version that was packed with the LNP at the time), combat sounds were almost unusable, because they'd all be queued up and each sound was a lot longer than the actual combat event in question. I'd end up having to pause the game a bunch to let the combat sound channel resolve.

SoundSense is better in that it seems to play the most recent combat sound, rather than queuing them up; which means that if you're hearing a combat sound, combat is currently ongoing.

What approach does SoundSense-RS take?
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

jecowa

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #5 on: February 08, 2020, 07:48:41 pm »

How does this handle combat sounds coming in too fast to complete? When I tried SoundCense (the version that was packed with the LNP at the time), combat sounds were almost unusable, because they'd all be queued up and each sound was a lot longer than the actual combat event in question. I'd end up having to pause the game a bunch to let the combat sound channel resolve.

SoundSense is better in that it seems to play the most recent combat sound, rather than queuing them up; which means that if you're hearing a combat sound, combat is currently ongoing.

What approach does SoundSense-RS take?

If there's too much stuff going on at once, it just doesn't play anything. It goes silent. It does not queue things up. Around five units fighting at-once in the arena seems like too much for it.
« Last Edit: February 08, 2020, 08:00:16 pm by jecowa »
Logged

prixt

  • Bay Watcher
  • has been taken by a fey mood.
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #6 on: February 09, 2020, 11:13:17 am »

It seems the main draw for my version of SoundSense is its low memory usage... Interesting.
I was looking into swapping the GUI crate this uses, but changing to something that doesn't use webview pretty much doubles the binaries memory.
What features do you think I should prioritize?
Also, jecowa reported the GUI not displaying on their OSX; do other people have problems with it too?
« Last Edit: February 09, 2020, 11:14:57 am by prixt »
Logged
SOUNDSENSE-RS - SoundSense alternative written in Rust

prixt

  • Bay Watcher
  • has been taken by a fey mood.
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #7 on: February 09, 2020, 11:34:37 am »

Quote
Any possibility of converting this into a WebAssembly application which is supported by the Rust build system apparently.

Milo Christiansen did that with his Rubble modding system for DF, as a way to streamline the deployment and the debugging of the UI of his application over the many OS supported by DFHACK (Windows, Linux, OSX).

Then; only one application wasm package would be usable in all the 3 OS.
SoundSense-RS uses a lot of dependent crates, and in order to target WASM, all of the crates must be able to target WASM. So I don't think this will be practically possible.
Logged
SOUNDSENSE-RS - SoundSense alternative written in Rust

jecowa

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #8 on: February 09, 2020, 08:12:54 pm »

Hey, prixt. I just wanted to let you know I'm including SoundSense-RS in the Lazy Mac Pack.

I tested it on a Debian/Ubuntu-based Linux machine. I got the same problem with the GUI as on Mac, except the Linux version also gave me an error message: Failed to load module "appmenu-gtk-module".

I like that it doesn't use disk space and doesn't need third-party software to run. It looks like the current memory usage is ~25 MB and the disk usage is 2.5 MB. If these doubled, I don't think it would be a big deal. I don't mind not having volume controls, but it would be kind of nice.
Logged

prixt

  • Bay Watcher
  • has been taken by a fey mood.
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #9 on: February 10, 2020, 02:05:49 am »

Hey, prixt. I just wanted to let you know I'm including SoundSense-RS in the Lazy Mac Pack.

I tested it on a Debian/Ubuntu-based Linux machine. I got the same problem with the GUI as on Mac, except the Linux version also gave me an error message: Failed to load module "appmenu-gtk-module".

I like that it doesn't use disk space and doesn't need third-party software to run. It looks like the current memory usage is ~25 MB and the disk usage is 2.5 MB. If these doubled, I don't think it would be a big deal. I don't mind not having volume controls, but it would be kind of nice.
Thank you for the inclusion!
Logged
SOUNDSENSE-RS - SoundSense alternative written in Rust

jecowa

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #10 on: February 11, 2020, 06:15:18 pm »

Mac GUI:

Logged

prixt

  • Bay Watcher
  • has been taken by a fey mood.
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #11 on: February 12, 2020, 12:11:44 am »

Mac GUI: ...
Cool! Can I use it on the repos README?
Logged
SOUNDSENSE-RS - SoundSense alternative written in Rust

jecowa

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #12 on: February 12, 2020, 12:50:22 am »

Yes, it's fine with me.

How does it determine if something is Weather or Music?
« Last Edit: February 12, 2020, 02:29:21 am by jecowa »
Logged

prixt

  • Bay Watcher
  • has been taken by a fey mood.
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #13 on: February 12, 2020, 04:18:24 am »

How does it determine if something is Weather or Music?
Each sound entry can have a channel parameter(music, weather, swords, etc.). If it doesn't have any, its put into the misc channel.
Logged
SOUNDSENSE-RS - SoundSense alternative written in Rust

jecowa

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #14 on: February 12, 2020, 06:50:34 am »

Currently the "Swords" channel is unused outside of the sample.xml in the Default Pack. And I think that's just an example pack that's meant to be deleted.

Currently none of the stuff in the Battle Pack from the "Official Pack" uses a channel, so I moved everything from the Battle Pack on the "Swords" channel. I'm not very experienced with SoundSense, so if you have any suggestions, I'm interested.

Nice thing about sound packs on GitHub is that you can get updates without downloading the whole thing every time. https://github.com/jecowa/soundsensepack/releases
Logged
Pages: [1] 2 3 ... 7