Skip to content

Conversation

@dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Jul 12, 2025

This PR aims to help somewhat with #126 by doing two things:

  1. Removing unused sound files. This time I did the removal less manually, and used some scripts to try and find the used files. Hopefully, I got this right! It seems fine running the game after the removals
  2. Re-encodes all OGG files with VBR. I didn't look at every file, but quite a few were fixed bit rate, rather than variable bit rate, so I did a mass conversion via ffmpeg -c:a libvorbis -qscale:a 3. Converting to VBR is theoretically a very conservative change because VBR vs fixed shouldn't have a noticeable change in quality. However, since the source file was also an OGG and it's a lossy format, just re-encoding at all will lead to some quality loss. If the original source files were available, re-encoding from them would be better

I split these two changes into two separate commits, because I'm not entirely sure about nr 2. Unless I messed something up, I think nr 1 is a pure win, however, nr 2 may represent a small loss in quality as described above

OR, we may want to consider a more extreme version of nr 2 where we reduce the sample rate (would have a noticeable difference in quality, but may not matter given the ambient nature of the audio?) or use a lower quality setting for VBR (so having a lower overall bit rate, again, with a noticeable loss in quality).

Here are the size numbers for the assets/sound directory:

  • In main: 46 MB
  • After nr 1: 38 MB
  • After nr 2: 27 MB

So, about a ~20 MB reduction in the source files. When exporting to web, I see about a ~18 MB reduction in the size of the PCK file

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.

1 participant