Wind spells have sound now
Using LMMS and ZynAddSubFx I made two wind sound effects, which now play when casting a wind spell. You can hear them in the attached video.
Cross-Compiling is fun
The speech recognition system is written in Rust, which compiles down to native code. This means that it needs to be compiled separately for each operating system, and processor architecture.
Rust is more friendly to it, then C or C++ for example, but as always, compilation finds it own weird ways to break.
I took the setup used by Sable as a base, with two Docker containers, one for Linux and Mac, and one for Windows. BUT:
- The Rust version installed in the docker image was not new enough for one of my dependencies - I had to update the rust toolchain in the container image.
- Compiling for linux required ALSA headers for audio access - I had to figure out, how to install them in a way, that works for both x86_64 and arm64, without breaking each other.
- The latest version of the base image has Mac cross compilation broken - I had to use a previous one.
- The image ships a MacOS SDK from 5 years ago - too old, doesn’t work, so it also had to be replaced. - the container is kinda becoming a Ship of Theseus xD
- My code was pulling openssl as a dependency, which was failing to compile - I had to spent over an hour, figuring out how to get rid of it from the dependency tree, discovering I can do so by updating a dependency to an unreleased version.
- Gradle obviously required some tweaks, who doesn’t love Gradle right?
In the end I managed to get it working, which brings the mod closer to being usable by the public, outside dev environment.
Downloading the model
The mod works by running an IPA speech recognition model locally. The model weights around 1.2G, making it too large to be embedded in the mod jar.
So I added automatic download support - the model can now be downloaded automatically on the first time an user runs the mod. There is even progress tracking, though it’s not hooked up to Minecraft yet.
A Toast is also shown when the loading fails, making the mod more user friendly.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.