Skip to content

Eldrune: Reduce music size#2137

Merged
manuq merged 3 commits intomainfrom
eldrune-reduce-music-size
Apr 21, 2026
Merged

Eldrune: Reduce music size#2137
manuq merged 3 commits intomainfrom
eldrune-reduce-music-size

Conversation

@wjt
Copy link
Copy Markdown
Member

@wjt wjt commented Apr 21, 2026

Minstrel_Dance.mp3 is 5.3 MB: the largest file in the exported project, almost 2 MB larger than its nearest rival, and 5% of the total size of the game.

A couple of other tracks in this quest are also large, though not so dramatically.

Convert these to Ogg Vorbis at a slightly lower quality level that to me still sounds good and reduces the size. Use BackgroundMusic nodes, reducing the amplitude of one of the tracks so that it is quieter than the sequence puzzle shells, and adjust the pitch of one of the shells to match the music.

wjt added 3 commits April 21, 2026 14:30
The MP3 file was 5.3 MB: the largest file in the exported project,
almost 2 MB larger than its nearest rival.

The reason it is so large is that it is compressed at 320 kbps.

Unfortunately the author does not provide an uncompressed version, so I
had to use the already-lossily-compressed audio. Converting it with this
command:

    ffmpeg -y \
        -i scenes/quests/story_quests/eldrune/Musica/Minstrel_Dance.mp3 \
        -c:a libvorbis \
        -q:a 3 \
        scenes/quests/story_quests/eldrune/Musica/Minstrel_Dance.ogg

yields a much more reasonable 1.8 MB file at approximately 112 kbps.

Rename the .license file to match. Update the scene to use a
BackgroundMusic node rather than an AudioStreamPlayer2D node, and in the
process play the music back through the Music bus rather than the Master
bus.

Helps #1707
This was previously one of the larger tracks. Recompressing it to Ogg
Vorbis reduces its size a little, from 3.1 MB to 2.4 MB.

Rather than converting the MP3 to Ogg Vorbis, I found that the original
author publishes a lossless WAV file, so I converted that instead for
improved quality.

Again, use a BackgroundMusic node in the outro scene.
This only saves a small amount of space, but in the process (in
Audacity) I also reduced its amplitude by -10 dB, matching the
adjustment previously made to the AudioStreamPlayer2D node that played
it.

Update the scene to play it with BackgroundMusic rather than
AudioStreamPlayer2D.

The piece is in G major, so replace the F♮ note on one of the shells
with F♯ to match.
@wjt wjt requested review from a team as code owners April 21, 2026 13:35
@wjt wjt linked an issue Apr 21, 2026 that may be closed by this pull request
1 task
@github-actions
Copy link
Copy Markdown

Play this branch at https://play.threadbare.game/branches/endlessm/eldrune-reduce-music-size/.

(This launches the game from the start, not directly at the change(s) in this pull request.)

@wjt
Copy link
Copy Markdown
Member Author

wjt commented Apr 21, 2026

This shaves 4.2 MB off the .pck. I'm marking #1707 as resolved by this because this is the end of the easy wins that can be had by just compressing music.

Copy link
Copy Markdown
Collaborator

@manuq manuq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@manuq manuq merged commit 7d2b6de into main Apr 21, 2026
6 checks passed
@manuq manuq deleted the eldrune-reduce-music-size branch April 21, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compress large background music

2 participants