HearthSim / python-fsb5

Library and tool to extract audio from FSB5 (FMOD Sample Bank) files
https://hearthsim.info
MIT License
133 stars 38 forks source link

support for parsing fev file #9

Open MarStarck opened 7 years ago

MarStarck commented 7 years ago

i wanna parse information in fev file, any suggestions? thanks in advance

MarStarck commented 7 years ago

I have read part of the code and wanna try to parse the header of fev file, but i stucked here: you provide FSB5Header and fmt("4s I I I I I I 8s 16s 8s") for your binaryReader, but could I get the information of fev.... ? And what does the fmt("4s I I I I I I 8s 16s 8s") mean?

MarStarck commented 7 years ago

i found that 4s i i .. thing is the format of fsb5. typedef struct { char id[4]; / ‘FSB5’ / int32_t version; // ??? int32_t numsamples; / number of samples in the file / int32_t shdrsize; / size in bytes of all of the sample headers including extended information / int32_t namesize; // size of the name table int32_t datasize; / size in bytes of compressed sample data / uint32_t mode; / flags that apply to all samples in the fsb / char zero[8]; / ??? / uint8_t hash[16]; / hash??? / char dummy[8]; / ??? / } FSOUND_FSB_HEADER_FSB5;

but i searched almost everywhere and found nothing about fev file struct...

synap5e commented 7 years ago

The format string is a python struct format string, which, as you found corresponds to the struct definition. It is used to deserialize the header into the namedtuple FSB5Header.

I'm not sure how fev files are structured either, but as I understand it they just contain extra data about playing the fsbs. Maybe try creating some known fevs using fmod studio and see if you can find patterns in the fev files. e.g. you could change a single parameter and check what bytes it changes in the fev using a hex editor.

lukasjuhrich commented 2 years ago

With “fev file”, do you mean .bank files whose first proper RIFF chunk starts with FEV[…]? They contain more data than just the sounds and I haven't found a complete spec yet, but in essence they're just RIFF files optionally containing the FSB5 data in a last SND chunk.

For instance, it can look like this (printing chunks to level 1): image

(yes, I know I'm a little late to the game, but perhaps this is helpful to anyone else reading this)