Romhacking => ROM Hacking Discussion => Topic started by: ivecocrossway on June 13, 2020, 07:39:07 pm

Title: Extract Music/SFX and maybe change it.
Post by: ivecocrossway on June 13, 2020, 07:39:07 pm
Title: Re: Extract Music/SFX and maybe change it.
Post by: peixemacaco on August 02, 2020, 01:36:46 pm
Hi ivecocrossway , would you please say for what system was and the solution?

I'm definitely interested in Music/SFX change and I think some others too.

Title: Re: Extract Music/SFX and maybe change it.
Post by: FAST6191 on August 02, 2020, 05:11:59 pm
Hi ivecocrossway , would you please say for what system was and the solution?

I'm definitely interested in Music/SFX change and I think some others too.


Generally speaking

16 bit and older. Most devices here were custom sound hardware that you actually programmed. and various other things he did, or maybe some of the stuff for the C64 are good here.

As such everything was custom. Check to see if someone has gone before you*, if not then time to have some fun with the hardware documents for the system in question.
N64 was also somewhat this, or at least was in many games (I remember watching the developer let's play of various Rare titles and they went in some depth about the sound). This is what leads to the perception that sound hacking is hard, and it is not an unjustified position for those systems. Other systems however might be far easier such that someone that can follow a simple guide is more likely to run out of musical talent before they run out of technical hacking talent.
Exception might be the Amiga, though much like anything based on optical media then anything with a floppy disc and a thus usually a file system changes things (as does PC of the era but that always will, PC also increases chances for encryption). Amiga has various quite high end sequencer/tracker type formats which various devs use and thus you might even be able to open them straight with , many later game devs and console makers would use formats started here and familiar to those tools.
As time went on the hardware tended to get if not better then more expansive and able to play more audio notes at once, more quickly and by the time we started to see CDs appear most things could probably play enough notes that the average perfect pitch possessing music school composition type can't pick them all out.

*various people do extract audio to be used with various playback emulators and plugins for things. Check around where these plugins are made , and (though also good for newer stuff) also worth linking at this point.

PS1. See if it is CD Audio first of all. There are some that would go outside it.
Dreamcast and beyond. Various audio formats that might depend upon the system. Sometimes it also varies depending upon the format within the system -- pulling apart Wii downloadable games, or xbox 360 xbla/indie downloadable games, is sometimes rather different to the disc based stuff on the same system(s).
and so on and are also valuable tools.

GBA. See if it the Sappy audio format . This is the one Nintendo provided, though there are others. is a nice hardware document on the GBA audio hardware.
DS. See if it is the SDAT audio format, and hardware wise it is loads of free to use channels compared to a handful of dedicated ones. Most games used this which Nintendo provided. Split between a sequenced format called SSEQ with its audio samples being called SBNK, short wave samples under the banner of SWAV/SWAR and long wave (PCM or ADPCM, which the hardware itself supports) called STRM but not all games support that (though there are simple enough hacks for a few games to shove a measure of wave decoding in). VGMtrans, vgmtoolbox and much more are available to mess with this. covers some of the other formats that have been pulled out of things.
3ds, PSP, Vita and beyond also have their formats. Newer games on consoles might share things with a PC, though I should note the xbox 360 had a custom version of the WMA (it is a Microsoft device after all) thing it decoded in hardware so there is that.
GBA and beyond are where audio hacking turns from "yeah you are going to have to be an accomplished hacker to do much other than mute things" to said follow along with a guide maybe 10 steps in length and then it is your composing skills that will be the limiting factor.

Extraction is different to alteration, indeed you can usually just find a nice point in the emulator or game on hardware if you have a means of getting sound out/out of your TV and loop it back if you really want. Even if you do have to make a decoder that will usually be easier than figuring out what the game/system wants for the encoding side of things (might want data in a given format and only of a given length, but you might have more options than the original devs used...).
Alteration will depend upon what the audio is -- sequenced audio is basically a list of notes to play back (though various systems will have either software defined notes, or baked into hardware ones, and sometimes for the soft stuff the console makers will provide a premade audio library a lot of devs used. The library of sounds is often referred to as a sound font) and maybe a few fun features like loop and audio bend things. Figure out the format and you are good. If it is a digitised sound file then you are left with editing that how you will, but not before figuring out the format used (MP3 was until recently in patent so a lot of things will either be straight wave or something rather more custom, though others might be OGM which was specifically designed to dodge this) and its import raw option then being a valuable tool. It will tend to be a final mix in the game, even if you otherwise have many free and clear audio channels, so separating instruments might be harder. Big exception being music games which at one point were noted as being a better source for some music than the official CDs -- but that was more loudness war issues than having multi layer tracks available to play with as you will. Said music games will also often need a gameplay track as well to play along/dance along to -- audiosurf is great fun but it would struggle to pick out notes to turn into something, never mind make a dance ( , though playing hacker you are presumably less bothered by clearing all the rights if you did want to change something around if it is one of those "publisher would only spring for a sound alike" games).
Title: Re: Extract Music/SFX and maybe change it.
Post by: peixemacaco on August 02, 2020, 08:07:42 pm
How complete your reply, Fast6191  :o

But I need to say, that we are successfully changing audio from Mega Drive games.
For example, Fifa 2020 our (me and T.A. Marcos) last hack , published here... we had changed chantes from the crowd in the game even with audible voices. The goal when you press A, and another voice when you press C (after the goal) , and when a player suffer foul, there is a voice saying this, not present in original Fifa 95.

And I'm with another project SSF2 that I'm changing with success voices and other sound effects by the Arcade ones.

So, because of this, I am curious about what system and the solution ivecocrossway did...

Title: Re: Extract Music/SFX and maybe change it.
Post by: FAST6191 on August 03, 2020, 10:42:06 am
That was a terribly basic overview as far as I was concerned, missed out on loads of things that make for easy hacks.

As far as megadrive and prior. It is not that you can't change it (far from it -- we have both evidence of it and there is no theoretical barrier to it) but that changing will either require someone to have gone before you and categorised the game/engine or format (most of which were not really shared between games) and possibly made a tool or for you to get down and dirty with a debugger to figure out what the given game did, something generally considered a high level skill, and either way you will still be limited by either what the hacker expanded it to or the hardware itself, most of which has serious limitations.
Compare that to later systems where formats were common to the system, in games or in general (all those amiga formats went wide), and there is a decent chance there is a plugin for your favourite audio sequencer/tracker editor such that someone whose association with the word register is not "small section of memory within a CPU or memory handling a piece of hardware" but either what your teacher wrote in during school to make sure you were there or usually prepended with "pitch".
Title: Re: Extract Music/SFX and maybe change it.
Post by: peixemacaco on August 03, 2020, 02:38:50 pm
Understood Fast6191, but I think you must play and listen the audio changes we actually did.

Ok, I will say a tip.

Open on an Audio Editor (Sony SoundForge, Goldwave, Audacity, etc.) for example, a Mega Drive/Sega Genesis rom.

Normally with this settings: On SoundForge (to the app import and work with the rom) per example
Sample rate 11025 , Sample tipe 8bit PCM, Format Unsigned, Byte order (none), Format: Mono

You click to open and voilá! Appears the track, you can click and play, with success you will find the audio and maybe some music in it.

But this settings vary from game to game.  So, you may try changing from 11025 to 8000, 5500 or even 4000 (sample rate) ... And some games only open with Stereo , or even Signed  bit.

To change, you must respect the format you'd imported and the same duration of the clip.

To export, simply go to File/export/ As raw
Finished, exported? Now , rename the extension to .bin (Mega Drive)

Do the checksum fix and play to see if worked... sometimes fail, but we are having success...

Please, if you try Fifa 20 by T.A. Marcos, you will listen my voice in the beginning and several new sounds into the game.


ps: Of course this tip works for other system console roms.... :thumbsup: