-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MSADPCM audio format decoding support #19125
Conversation
Added a testcase, Need to extract track from the meg-package with https://modtools.petrolution.net/tools/MegEditor and update the filename. |
The new audio player in #19143 should make testing this much easier: add the meg package loader and mount the package in mod.yaml, then select it in the asset browser. |
Works as expected and everything else lgtm, so 👍 once the points above are sorted. |
d10c616
to
a7fe8fb
Compare
: nibble; | ||
|
||
s2 = s1; | ||
s1 = (short)(twosCompliment * idelta + predict).Clamp(-32768, 32768); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, sorry, this actually needs to be .Clamp(-32768, 32767)
!
Clamping to +32768 introduces noticeable audio glitches in certain files (e.g. EN-US\TDR_SFX_UNT_YESSIR1.V03_EN-US.WAV
).
LGTM after this final fix. Maybe also a good time to remove the testcase?
If anyone else wants to test this i recommend rebasing on top of #19143, adding MegV3
to mod.yaml's PackageFormats
list, and mounting MUSIC.MEG
or SFX2D_EN-US.MEG
in the packages list.
a7fe8fb
to
8d96704
Compare
Updated. |
Resurrection of #18552
Supersedes and closes #18552.