I'm going to copy and paste an earlier post of mine. This relates to GBA audio samples.
Hi welcome to another exciting ROM hacking effort post. Today we’ll learn how to dub your own voice into a GBA game and then share your work with the world. We start undubbing Zelda Link to the Past as a hands-on example. If you’re new to this or like what you see then check out the last couple posts by
univbee and
I.
Tools:
- A cheap pair of headphones
- An audio editor that can support raw PCM data. I recommend anything with Cool Edit in the name. Adobe Audition CS6 and CS3 support PCM but not anything in between. Any version of Cool Edit Pro should work too. I don’t know anything about Goldwave or Audacity.
- An IPS Patcher like
Lunar IPS.
Raw Voice Samples
Start off by making a copy of your ROM and change the file extention to .pcm. Open it in your audio editor and make sure your speakers are off.
GBA games use straight up raw waveform (wav) audio samples for many sound effects and instruments in songs. These are called “voice samples” whether they’re instruments or voice acting or whatever. While the games can have whatever quality they want 95% of the time they use a sample rate of 11025. Open it as a signed mono 8-bit PCM.
Like everything else in a ROM audio samples are just numbers. In a hex editor a game looks like numbers, in a tile editor it looks like colorful fuzz, and this is what the GBA ROM looks like in an audio editor.
Look closely at the image above. Most of the file is full volume white noise. Listening to this game data as audio is uncomfortable and actually bad for your audio equipment. That's why you have the crappy headphones. When you’re really digging for voice samples you might have to listen to a lot of it but here we can see a part of the game data that is more structured looking starting around 3:10.
Most of the audio we can hear starts with a tiny ‘blip’ and sounds like instruments in varying pitches. Link to the past does something that very few GBA games do; it uses a few different sample rates so certain instruments are higher quality than most GBA shlock.
Seen in the picture above are all of Link’s voice clips. Each one has a tiny line in front of it that the audio editor interprets as a blip. This is actually a little important piece of data. It’s a header that says “yo this is a voice sample.” We don’t even want to bother with a hex editor so we’re leaving that alone.
Using wicked zooming we can start the to-be-changed selection a little after that header. It’s good to give yourself room so feel free to start a little later. There is no way anyone is going to hear another 100th of a second before Link really starts screaming.
Silencing the audio just replaces your selection with 00s. Keep it selected and open up your personal recording you made of all the sounds in Zelda LttP. Or go to the Webpage with
every Zelda sound ever.
Copy and mix-paste in the new sound. It’s important that your new sound is shorter than the old one. Mix-paste will combine the silence and your new sound while retaining the size of your selection.
Then you have to save the ROM again as PCM data. This part is not totally straight forward and is impossible in Adobe Audition CS4, CS5, CS5.5. In fact at this point in the tutorial hit a snag where I couldn’t figure out how to get Audition CS6 to save the whole file as a .pcm without subtly changing data throughout and ruining the ROM. Christ. Someone please figure this out for me.
I could use just that part and memory addresses but believe me this whole process is easier when you don’t even touch a hex editor.
So I just fell back on using Cool Edit Pro 2.0 and redid the whole process and just saved. Pictures still apply.
[video type="youtube"]KQXK9W0D-9Q[/video]
There now Link sounds like Link when he falls. This might be worth finishing if apathy or real life - the two nemeses of any good ROM hacker - don’t kick in first.
Using this technique you can redub certain games. It’s nice to just silence Mario and company saying “Woo-Hoo! Just what I needed!” in all those Mario Advance games but I like Yoshi making modern Yoshi noises.
People have put this technique
to work making the music in the GBA Final Fantasy titles not sound like total garbage. There’s also one that changes Link in Minish Cap to sound like Link in Wind Waker.
The basic principles of audio sample editing can apply to other systems while the process and settings can vary a bit. Actual audio clips in some NES and Genesis games like the SEEGAA logo in Sonic games are just a quick edit away.
These things are so easy to find and edit for the same reasons as the graphics in my last effortpost. These all raw and uncompressed for quick and easy access to the game’s memory. This is the stuff that needs to load up instantly at the cost of being uncompressed and taking up more space.
IPS Patches
Distributing and redistributing ROMs is a legal grey area and some ROM hackers are absolutely terrified by this. By creating a patch that only contains the changes you’ve made and info about where those changes go you can distribute files that are completely composed of your original work. If you’re worried about all of the stolen art and intellectual property in your patch that you add or modify with the game then congratulations you’re either overthinking this or you understand why only distributing a patch doesn’t make sense and is inconvenient.
Popular ROM hacking website
Romhacking.net only accepts patch files. Most game ROMs use IPS patches. Big games or ISO images often use PPF patches but we’re not doing that.
[super]Yeah this is simple stuff.[/super]
To make an IPS patch you take the original ROM and your modified ROM. When you click “Create IPS patch” in Lunar IPS it will prompt for the two files, look at the differences, and drop out a patch. Now when someone has this patch and original file they can make a copy of your ROM hack all by themselves.
When creating or using an IPS patch it’s important to note the what version of the game the original ROM file is. Depending on the game the results could be a disaster. Different regional releases of games can be quite different. Super Mario Bros. has two versions, one with and one without the title screen. In this case you can compare your modified ROM against all versions of the original game and then release multiple patches even if you only ever modified one version of the game.
Some games by dumped by piracy groups have specials intro or trainer screens when you start up the game. Usually these are placed in free space at the end of the ROM and aren’t a problem but sometimes they can be. Try out your patch on a clean ROM before uploading it somewhere.
Personal recommendation - distribute your ROM hack as both a patch and a ready-to-go ROM separately. Most everyone would prefer to just get the ROM, but some sites prefer the patches. If you are ethically or legally concerned about uploading a ROM somewhere then don’t do it, that’s what the patches exist for.