-
Notifications
You must be signed in to change notification settings - Fork 4
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
MIDI files are truncated #1
Comments
Thanks @kode54 for looking into this. I'm using this page as a reference for the file format: I have written a simple program to parse the RIFF files, but trying to parse 370.riff using this structure gives me the following data:
You refer to a length field, but where are you getting this from? Do you have a format specification I can look at? |
RIFF is a generic container format. The total file length, minus 8, is written immediately following the 'RIFF' and immediately before the field describing which format the file is, 'MIDS'. |
Thanks again @kode54! By reducing the length field by 8 and renaming to .mids I am able to play the files through foobar using your MIDI player component. The mystery sound files? The game soundtrack, in MIDI format. |
The lengths appeared to be correct, it's just that there's 8 extra bytes that whatever you used to extract them left off. |
I used a tool called Watto's Game Extractor. Not sure how it does the extraction. I'll contact the author, but I think it's unlikely I'll get a response. |
Thanks for contacting me Dan. Game Extractor was incorrectly calculating the length of the audio files as part of the scanner function, which I have now fixed and will include in the next release (3.07). I have sent you an email with a patched version which you can use in the interim to extract the files at their correct lengths. |
Yes, you can find an article on the format here: https://en.wikipedia.org/wiki/Resource_Interchange_File_Format It is a generic container format. "RIFF" is the header signature, the four bytes following it contain the length of the data following that field, and thus the total size of the file minus the 8 bytes that make up the signature and the length field. The four bytes which follow the length are the type identifier, which is "MIDS" in this case, which I assume means a MIDI stream of some sort. It was used by a number of Windows games. My midi_processing library documents the RIFF MIDS format in its parser. It also documents an unrelated MIDI container format, the RIFF RMID format, which is basically just a standard MIDI file in the data chunk of a RIFF container, for the purpose of supporting RIFF INFO or possibly RIFF 'id3 ' tagging. https://github.com/kode54/midi_processing E: Edit further: I just overexplained in a reply, before I realized I had my email client configured differently on this machine than my desktop. It's set to show newest posts at the top, so I was replying to your oldest message again. Oops. |
Thanks @wattostudios for the fix, I have re-extracted the audio files and they work fine now! And thanks @kode54 for the extra info 😁 |
feat: create cmake skeleton for open-rival target feat: add external libraries in cmake feat: include directories instead of specific headers Signed-off-by: Ricardo Benitez <benitezc.ricardo@gmail.com>
The RIFF file length fields report that the files are truncated. The file should be as long as the RIFF main body's length plus 8 (for the 'RIFF' and the length field). The last stream chunks of the files are also truncated.
I haven't checked the rest of the files, but it appears at least 370.riff is truncated by exactly 8 bytes, so I guess the ripper wasn't taking the RIFF header and length field into account when considering the value of the length field, which does not include those 8 bytes.
The text was updated successfully, but these errors were encountered: