c47edit icon indicating copy to clipboard operation
c47edit copied to clipboard

Possibilities of exporting or replacing music and cutscene audio files

Open SinaBrus opened this issue 2 years ago • 2 comments

Greetings! Hope you are having a good one. First I want to thank you and appreciate this great work of yours as it's always been a dream of mine and probably many others to mod and add more into this superbly underrated game. I was wondering if it's feasible to manipulate music and cutscene audio files? I'm not sure about the music files because they are encrypted but I think it can be done with cutscenes. And would you please tell me how you extract .wav files from English.bin?

SinaBrus avatar Jul 10 '23 21:07 SinaBrus

Hi! Thanks for your interest!

The music is handled by Microsoft's DirectMusic, which is an old SDK for music playback used by several games back then. In older DirectX SDK you can find a program named "DirectMusic Producer" which can open and edit the music files from the game.

As for cutscene voice clips, the English.bin is actually just a bunch of WAV files concatenated together in a single file. The order of the WAV files are indicated in the English.idx file, which is a text file containing a directory listing of the WAV files.

(My best guess it that the devs seem to have used some Linux shell to list all the WAV files with ls -l > English.idx then concatenated them all into a single file with cat 1.wav 2.wav ... > English.bin. The game then probably uses the English.idx file to locate the wav files in the English.bin, the offset of a wav file simply being the sum of sizes of the previous wav files.)

Right now there is no automatic process to extract them, but it's still feasible to extract the wav files from English.bin via a hex editor. And pretty sure one can write a simple script to automatize the task via a few lines in Python. Same as for creating the English.bin/.idx files.

Regarding c47edit, not sure if I would implement manipulation of music/voice clips in it, as the editor is more focused on editing a single scene file. Probably simplier to implement them into its own tools (there's already DirectMusic Producer for the music).

AdrienTD avatar Jul 10 '23 22:07 AdrienTD

I'm very thankful for your answer. Hope we see more great projects from you. SAEdit maybe...:)

SinaBrus avatar Jul 10 '23 23:07 SinaBrus