morris / vstools

Toolset for Vagrant Story (2000, Square), written in JavaScript with Three.js
https://morris.github.io/vstools/
MIT License
97 stars 9 forks source link

Audio extraction #6

Open morris opened 4 years ago

morris commented 4 years ago

This has been the most hard for me, and haven't made progress in years. Current state (broken) is in src/Akao.js and src/SOUND.js.

Any help is much appreciated, e.g. documentation, other sources that solved this for other games, etc.

korobetski commented 4 years ago

This is my AKAO decoder in C# for Unity : https://github.com/korobetski/Vagrant-Story-Unity-Parser/blob/master/Assets/VS/Parser/AKAO.cs and folder https://github.com/korobetski/Vagrant-Story-Unity-Parser/tree/master/Assets/VS/Parser/AKAO for sub classes.

AKAO files in MUSIC folder works like a midi file, so its more like a sequence of notes than a music. AKAO files in SOUND folder are compressed samples banks that works a little bit like sf2 or dls files. So to get a listenable music, you need to convert an AKAO music into a .mid file, and associate it with the good set of samples converted into .sf2 or .dls and then finaly synthetize them into a .wav file.

Starting with decoding the musical sequence seems to me the best thing to do.

korobetski commented 4 years ago

I'm sure you already know but if not, you should take a look at it to understand the AKAO binary data: https://github.com/vgmtrans/vgmtrans/releases

Open MUSIC040.DAT with WAVE0070.DAT for example, this is the Fatory music.