Repository navigation
feat(optimize): add opt-in --flac to re-encode wav sounds - #910
Merged
Merged
Conversation
optimize --flac re-encodes a table's PCM WAV sounds as lossless FLAC, on top of the lossless image and font fixes it already runs. It is a separate flag because, unlike the image fixes, it changes which builds play the table: only vpinball with the miniaudio sound engine (10.8.1 and later) decodes FLAC, so an older build would play without those sounds. Without the flag optimize behaves as before. apply takes an Options struct, the report gains the converted sounds and the wavs left alone with their reason, and format_outcome prints a line per sound with the bytes before and after. Bumps vpin to 0.37.4 for fix::wavs_to_flac.
Owner
|
I did not expect that much size reduction 👍 |
Merged
This was referenced Oct 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on the FLAC conversion that landed in vpin (
fix::wavs_to_flac, francisdb/vpin#545) and surfaces it inoptimize.optimize --flacre-encodes a table's PCM WAV sounds as lossless FLAC, on top of the lossless image and font fixes it already runs. It is a separate flag because, unlike the image fixes, it changes which builds play the table: only vpinball with the miniaudio sound engine (10.8.1 and later) decodes FLAC, and the sound manager accepts.flacsince vpinball/vpinball#4066, so an older build would play the table without those sounds. Without the flag,optimizebehaves exactly as before.applynow takes anOptionsstruct, the report gains the converted sounds and the WAVs left alone (with the reason), andformat_outcomeprints a line per sound with the bytes before and after. Bumps thevpindependency to 0.37.4 forfix::wavs_to_flac.Tested end to end against four real tables: each shrank substantially (Aliens 498 -> 201 MB, Guardians 508 -> 359 MB, Batman 66 308 -> 240 MB, America's Most Haunted 348 -> 290 MB), the output re-reads and verifies, and the converted sounds play back correctly in vpinball with the miniaudio engine.