don't click here

So, hey, figured out how to replace sound effects in Heroes.

Discussion in 'Engineering & Reverse Engineering' started by Herm the Germ, Jun 20, 2011.

  1. Herm the Germ

    Herm the Germ

    Hmm, not bad. Well done, doctor! Member
    1,482
    0
    0
    Dresden, Saxony, Germany
    MIDI-to-SMPS-conversions, mostly. Takin' requests, too.
    The interest in this is probably not too high, but nevertheless, here's what I do have in terms of information on the subject. Before doin' anythin' with those, be sure to make some back-ups.

    PAC Files, as has been figured, are:

    a) A format re-used from the PSO games
    and
    b) basically a bunch of PCM wave files, little endian, 16 bit, 22,050 Hz, mono, chained one after another with a bunch of headers to tell the game which sound is which.
    The Heroes PAC format is a tad bit different, but nevertheless, the written-for-PSO tool PAC Manager version 0.4 can handle these files relatively well. Previous versions and the following version 0.5 cannot handle the Heroes PACs for various reasons, mostly since those versions are almost exclusively geared towards the actual PSO .pacs, complete with reference-addresses built-in that won't do no good with Heroes' files.

    PAC Manager will give you a file list, labelled Sound 01-XX, depending on file-count. The first 10 files (at least in Bank0.pac) are Header data not usually found in PSO PACs. PAC Manager 0.4 erroneously reads these as 52-byte-long sound files each. Skipping past those, we got the actual sounds.
    Using BlazeHedgehog's guide on how to listen to the sounds in the pack is a good way of figuring out which sound number is which.
    It's a good idea to extract the sound you want to replace first.

    The file you want to insert should be no longer than the original sound, as PAC Manager cannot expand the PAC-files. Hence it's a good idea to have the original out for size-comparison's sake.
    The file you want to import must be a 22050 Hz 16-bit Mono PCM Wave-file.

    If all went well, your sound is now in the .pac file. Remember to save the modified .pac, though.

    Finally, you must do one change to the archive. Open and compare the .pac header of the modified file with the back-up file in a hex-editor and you'll see that there's stuff missing. This is likely due to, as established, PAC Manager assuming the Heroes .pac-header being 10 sound files instead of the file's header. This can be fixed by simply copying and pasting the first 352 bytes from the back-up into the modified file. Saving that, the sounds should now work flawlessly in the game.

    If I explained anything in a dumbass, not-understandable way, do hit me with a heavy object and correct me.
     
  2. Aww... I had figured that out long time ago...

     
  3. Herm the Germ

    Herm the Germ

    Hmm, not bad. Well done, doctor! Member
    1,482
    0
    0
    Dresden, Saxony, Germany
    MIDI-to-SMPS-conversions, mostly. Takin' requests, too.
    Yeah, but your method showcases in and off itself the flaws with just editing the .pac files in an audio-editor -- note that the rainbow rings do not play any sounds, for example, because the accompanying sound effects have been pushed away from their original position. Without manually editing the header within the .pac file, the game is unable to find the sound again. With my method, while it's limited by the size of the original sound files, it does keep all the soundeffects past the point of editing intact.
     
  4. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    Maybe you should put all this hacking information in SCHG:Sonic Heroes instead of in a bunch of random forum topics?
     
  5. Herm the Germ

    Herm the Germ

    Hmm, not bad. Well done, doctor! Member
    1,482
    0
    0
    Dresden, Saxony, Germany
    MIDI-to-SMPS-conversions, mostly. Takin' requests, too.
    I was hoping someone who's better at explaining this stuff in a way befit for the Retro Wiki could do so. :c

    I guess I'll see what I can do with my mental notes in the next couple o' days…
     
  6. total

    total

    Member
    67
    0
    0
  7. Herm the Germ

    Herm the Germ

    Hmm, not bad. Well done, doctor! Member
    1,482
    0
    0
    Dresden, Saxony, Germany
    MIDI-to-SMPS-conversions, mostly. Takin' requests, too.
    Yeah, well, that's great. Can't code worth shit, though, and no one ever made anythin' with your awesome findings. D:
     
  8. Lobotomy

    Lobotomy

    35% Cognac Banned
    4,394
    1
    0
    Traverse City
    Project: Matter/Energy
    I hate to burst your bubble and be so blunt about this, but I did this in 2007, along with texture and music, and I'm sure I'm not the first.

    ...Unless of course you're doing this on the console version. If so, then disregard that, I suck cocks.
     
  9. Shadow Hog

    Shadow Hog

    "I'm a superdog!" Member
    So can you use this to replace the voices in the game with the Japanese ones?

    Or, now that I think about it, sweet, sweet silence.
     
  10. Herm the Germ

    Herm the Germ

    Hmm, not bad. Well done, doctor! Member
    1,482
    0
    0
    Dresden, Saxony, Germany
    MIDI-to-SMPS-conversions, mostly. Takin' requests, too.
    The only voice clips stored in the same format as the sound effects are standard grunts, and incidently, in the PC version, they're the only voice clips available in both English and Japanese, at least file-vice (bank3e.pac and bank3j.pac). Swapping those should give Japanese grunts but not much else. xD;

    Actual voice tracks are stored in dvdroot/bgm/SH_VOICE_E.afs. The PC version doesn't have the _J equivalent. Ripping that from the PS2 or XBox version and putting it into the game, replacing it with the _E file should give you Japanese voices, though.

    Complete silence is likely only possible by putting mute clips into the AFS archive (AFS explorer and ADX files are yer friend for that one, I guess), as deleting the archive from the hard drive just makes the game resort to using the version of the file found on the game disc, and by deleting bank3e.pac. : B It might be possible if you just delete a chunk out of the AFS header to cause the characters to go entirely mute, but, I haven't tested that yet.

    @Lobotomy: Oh, wow, really? D: Man, I never found any of that out.
    Judging but how little Googling the subject yields in terms of successful edits to the game in sound and textures, I would be very surprised if there were more than 5 people besides you and me who figured any of this stuff out, though.