UPDATE : the format is mostly understood at this point, check the work here : http://sdamo.io/ff7/index.php
Hello
This always puzzled me, the PC version using hundred of megabytes worth of wave files for sound effects, while the PSX version only used a tiny 50Kb file (EFFECT.ALL).
After some searches, there seems to be nobody interested into reverse engineering this, please correct me if I'm wrong ?
I just did an attempt this evening, to get a better understaning of this format. I'm interested in sound synthesis, in fact I'm the developer of a music software called
FM Composer.
So, here's my findings.
The data from byte 4 to 2829 is an offset table for each individual sounds. Each entry is 2-byte long. Some entries are "0xFFFF", I don't know why, let's say we ignore them. After byte #2829 there is an empty block made of 0xFF bytes then the actual sound data. Following this table I can extract 936 sounds from the file.
You can extract them with this little code I made, you need to put EFFECT.ALL in the same dir and create an 'out' folder. Compiled version here :
http://sdamo.io/ff7sfx.zipOr all the sounds directly extracted here :
http://sdamo.io/ff7/out.zipint main()
{
FILE *fp=fopen("EFFECT.ALL", "rb");
fseek(fp,8,SEEK_SET);
vector<int> offsets;
offsets.push_back(0);
unsigned short temp;
printf("Analyzing...\n");
int endcount=0;
do
{
fread((char*)&temp,2,1,fp);
if (temp == 0xFFFF) {
endcount++;
continue;
}
else
endcount=0;
offsets.push_back(temp);
}while (endcount<3);
printf("%d sounds found.\n",offsets.size());
printf("Extracting...\n");
fseek(fp,4096,SEEK_SET);
char *sound_data;
for (unsigned i = 0; i < offsets.size()-1; i++)
{
int size=offsets[i+1]-offsets[i];
if (size<=0)
continue;
sound_data = (char*)malloc(size);
fread(sound_data,size,1,fp);
FILE *fp2=fopen(string("out/"+to_string(i)).c_str(), "wb");
fwrite(sound_data, size, 1,fp2);
fclose(fp2);
free(sound_data);
}
fclose(fp);
printf("Done.\n");
}
All sounds seems to finish with an '0xA0' byte.
Okay it's nice but the hardest part is to figure how the format works. I've messed with the first sound of the file (which is the menu beep sound), by modifying random bytes directly in the ISO image, then restarting the game with an emulator, and yeah I've got more or less interesting results !
Check this :
http://sdamo.io/ff7/sounds.zip It's the altered beep sounds, depending on which bytes i modified (naming : chk-
[bytes modified])
Some results are really interesting, with some delays, pitch or noises...
Anyone interested in helping me to find how those parameters works ? (basically, which bytes/values affects which sound parameter).