-
-
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
Introduce loader for Meg V3 file format #18443
Conversation
I got to the point where I was able to select this audio file from the list, however it didn't play because of unsupported audio format unfortunately. The compression type is ADPCM which I found some documentation here: https://wiki.multimedia.cx/index.php/Microsoft_ADPCM I see IMA_ADPCM is supported which seems simpler according to this https://wiki.multimedia.cx/index.php/Microsoft_IMA_ADPCM It looks like to finish this off, I'll have to add support to this audio format also. |
I wouldn't rush on trying to get audio playback working in game: there are many pieces that need a lot more work before we will be able to ship that (reworking the filesystem/load code to support dynamic detection and use of the steam directory; reworking the music/notification systems to support split remaster vs classic definitions; adding the user-facing UI for selecting between the two). This PR should really focus on just the meg container format, and leave the other pieces to other PRs. |
@pchote thanks for reviewing while this was in draft. I mainly created it as such because I wanted to indicate to anyone else that there was a WIP that could be useful. I started going down the road of actually getting the audio to work because I thought that I was very close and didn't expect the blocker of unsupported wav file format. My main aim was to actually have the Instead I have done what I should have and created two commands that can list and extract In practice I am unsure if that will affect anything, or break anything because it was incorrectly able to read past the end. |
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.
I haven't had a chance to test this yet, but here are some more code style points to hopefully restart progress here.
3c80ace
to
4b1fcc7
Compare
Confirmed that filesystem consumers can read the contents of mounted meg files without problem. I'll need to do another pass for coding style before approving, and the fixup commits will need to be squashed. |
4b1fcc7
to
2f444ec
Compare
I rebased on bleed and squashed |
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.
Sorry for the delay, you might have noticed that I got a bit sidetracked by what this PR enabled 🙂
A bunch more comments to bring this more in line with OpenRA's coding conventions, and a couple of specific simplifications:
4bd7371
to
0405187
Compare
Thanks @pchote for your feedback. When I originally authored this we weren't targeting C# 7 so tuple's weren't an option; I am glad it is now! 👍 It is great to do the same stuff with less code. |
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.
A few final style nits, then LGTM.
These should bring us in line with the "proper" Megafile specs revealed in the new source release: https://github.com/electronicarts/CnC_Remastered_Collection/tree/master/CnCTDRAMapEditor/Utility
0405187
to
4716afe
Compare
I've updated the PR based on latest feedback and rebased on bleed. |
4716afe
to
e5b25ce
Compare
didn't notice the rebase label, have done so |
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.
LGTM after those last two nits.
e5b25ce
to
de6930d
Compare
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.
Confirmed that this is still working fine on my updated remaster branch.
This code will parse a Meg file used by the CnC remastered assets. I used this code to successfully extract a music file and was able to play it locally.
#18239