Repository navigation
OpenMiles sound issues - #41
Merged
Merged
Conversation
Patch 0002 mapped the 0..127 sample volume through a table interpolated from an earlier measurement and combined it with the master volume and the pan as exact floating-point gains. NOLF came out louder than with retail Miles (issue #31). Measured again -- a tone, and the game's own sounds, played through the retail Miles 6.0i mss32.dll and through OpenMiles under Wine, with ALSA's output recorded to a file -- Miles 6's arithmetic is integer and linear: each 0..127 volume is scaled to v * 128 / 127, a sample's level is (sample * master) >> 7 over 128, and a pan's far side is its distance from that edge over 64.5. OpenMiles now does the same for Miles 6 builds (and reads the master volume back as it was set), and the two agree within 0.01 dB at every volume from 127 to 4, every master volume and pan tried and for the game's PCM, IMA ADPCM and MP3 sounds; the old table was 1.5-3 dB too loud at the middle and low volumes most sounds use. Over two minutes of A Tenuous Lead (M05S03) the game is now 0.8 dB from retail Miles, where it was 2.5 dB; what is left is not in any sound measured on its own. OpenMiles' suite: no new failures (the four tests of later versions' curve fail as before). Refs #31 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The crane outside the warehouse in A Tenuous Lead (M05S03) drilled: the engine loops its sound, LIFT3.wav, over the file's cue region with AIL_set_sample_loop_block, in byte offsets into the sample's data, which for IMA ADPCM are compressed blocks. OpenMiles divided them by the decoded frame size, which put the loop at about an eighth of where it belongs, so the crane played its first 108 ms and then repeated a 66 ms stretch of it for as long as it moved. Recorded in-game, retail Miles 6.0i plays to 830 ms and loops back to 323 ms, the start of the block each offset falls in; patch 0005 makes OpenMiles do the same, and in the game it now does. OpenMiles' suite: no new failures (the four tests of later versions' volume curve fail as before). Fixes #31 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpenMiles resamples each sound to its 44100 Hz mix with miniaudio's pitch resampler, which miniaudio runs without its low-pass filter, so a 22050 Hz sound -- most of NOLF's effects -- came out with its mirror image at 11-22 kHz, 30-45 dB down. Patch 0004 turns the filter on at its highest order: the image above 12 kHz is now 58-84 dB down and nothing below 9 kHz changes, and the playback rate changing every 5 ms for 4 s leaves the output as steady as before (the instability miniaudio fears). Retail Miles 6.0i avoids the image only by mixing at the 22050 Hz NOLF asks for, which cuts the dialogue off at 10 kHz; recorded in-game (M05S03), the modern build's dialogue now reaches 14 kHz, an improvement on retail rather than a match. OpenMiles' suite: no new failures (the four tests of later versions' volume curve fail as before). Refs #31 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Focused on fixing #31.