gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Audio > Extracting Audio

#30909 - musicman3320 - Mon Dec 06, 2004 1:54 am

Hi all. Is there a way to extract the sound from an already compiled GBA rom? I have looked high and low for an extractor, but I cannot find one. Preferably a command line tool with source so I can compile it for Mac OS X, if it is not already in that format (which it probably isn't). The prefered extract format is .wav, but GBA format will be fine.

Thank you in advance for any help.

-Chris

#30910 - DekuTree64 - Mon Dec 06, 2004 2:13 am

Nope, no way to do it straight from the ROM, since just about every GBA game uses a different custom format for music, usually similar to MOD/S3M tracker types, so it all has to be played through code.

I believe you can record sound from VBA though, or do what I do when I really want a GBA song (my home computer is too slow to run VBA full speed) and run a cord from the GBA's headphone jack into your sound card's line in jack, and record with any old sound program.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#30921 - tepples - Mon Dec 06, 2004 5:04 am

Samples on the GBA are most often raw signed 8-bit data. Second most often, they're raw unsigned 8-bit data. You can extract those in any decent wave editor (such as Audacity), or you can write your own wave converter based on the wave format documentation at Wotsit.org.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#30949 - musicman3320 - Mon Dec 06, 2004 4:28 pm

Are you saying that I can just open the GBA rom with Audacity, or that it has to be extracted first and then opened with Audacity? I would be in awe if Audacity could just open a GBA rom with its sound.

Thank you to both of you for the help so far.
-Chris

#30977 - gb_feedback - Mon Dec 06, 2004 8:29 pm

The way I see it. If you open a rom in (eg) Goldwave (you will have to rename it *.snd - it seems), and say it is a 'raw' sound file, then Goldwave will ask you what format it is in. You will have to guess here, but could start with either PCM 8 bit signed mono or PCM 8 bit unsigned mono. You will also have to make an intelligent guess at a sampling rate (say of the order of 16kHz). Now you will have a big sound file where most of the file is digital rubbish. But if there is any raw sound then if you play the whole file (not too loud - you don't want to destroy your speakers) you may hear some sound samples played at probably the wrong speed. You can then use the app to select these regions and keep replaying them at different rates till you hear the right sound. Well it could be worth a try. If you're that keen. Don't know that I would.
_________________
http://www.bookreader.co.uk/

#30982 - identitycrisisuk - Mon Dec 06, 2004 9:05 pm

gb_feedback wrote:
The way I see it. If you open a rom in (eg) Goldwave....


Wow, I just tried that with Advance Wars as it's the smallest ROM I have, 8 bit mono signed at 16Khz and yeah there's a lot of noise but in the middle there is recognisable section with all the sounds. Unfortunately it won't help you get the music as it's mostly samples that I assume get used in a midi-like format (is that what mod files are like? I have no experience of them) so unless the game has full songs in PCM format I doubt you'll get anything. Very cool though and you don't need to rename the file with goldwave, just do all files *.* and it allows you to specify data format.
_________________
Code:
CanIKickIt(YES_YOU_CAN);

#30989 - tepples - Mon Dec 06, 2004 10:16 pm

identitycrisisuk wrote:
Unfortunately it won't help you get the music as it's mostly samples that I assume get used in a midi-like format (is that what mod files are like? I have no experience of them)

Yes, a .mod file is much like a .mid file with a sound font. A utility called Sappy can actually extract some commercial games' music as MIDI.

If you know that a game uses .s3m and not .mod or .xm, you will have to use 8-bit unsigned rather than 8-bit signed to read the ROM correctly.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#34230 - gbawiz - Sun Jan 16, 2005 12:16 am

Hello,
The process of extracting audio from some of your GBA games can be done by using a little application called saptapper which extracts the required data from the ROM and stores it as a GSF file.

GSF files appear to be compressed using a compression called Zlib and inside these files are: the tracking code, the track data and the samples and probably some other useful information also.
This means that the plugins for certain media players would be a form of emulator which executes the tracking code and emulates the sound hardware of the GBA, feeding the audio out through the media player.

interesing that saptapper knows what the tracking code looks like. Might be worth looking into saptapper which may provide insight into which particular music format it saps.

http://www.caitsith2.com/gsf/tools/saptapper.zip