Code Monkey home page Code Monkey logo

Comments (8)

Danjb1 avatar Danjb1 commented on July 21, 2024

Thanks @kode54 for looking into this.

I'm using this page as a reference for the file format:
http://www.vgmpf.com/Wiki/index.php/MDS

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:

header = RIFFD? MIDSfmt 
dwTimeFormat = 12
cbMaxBuffer = 384
dwFlags = 4096
numBlocks = 0

You refer to a length field, but where are you getting this from? Do you have a format specification I can look at?

from open-rival.

kode54 avatar kode54 commented on July 21, 2024

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'.

from open-rival.

Danjb1 avatar Danjb1 commented on July 21, 2024

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.

from open-rival.

kode54 avatar kode54 commented on July 21, 2024

The lengths appeared to be correct, it's just that there's 8 extra bytes that whatever you used to extract them left off.

from open-rival.

Danjb1 avatar Danjb1 commented on July 21, 2024

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.

from open-rival.

wattostudios avatar wattostudios commented on July 21, 2024

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.

from open-rival.

kode54 avatar kode54 commented on July 21, 2024

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.

from open-rival.

Danjb1 avatar Danjb1 commented on July 21, 2024

Thanks @wattostudios for the fix, I have re-extracted the audio files and they work fine now!

And thanks @kode54 for the extra info 😁

from open-rival.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.