unpacking a ROM to get a music rip?

Discussion in 'NDS - ROM Hacking and Translations' started by Diosoth, May 20, 2010.

  1. Diosoth

    Diosoth GBAtemp Fan

    Nov 25, 2008
    United States
    I want to know how to unpack/disassemble a ROM file solely to rip music from it. My personal interest is the music from Foto Frenzy, the best way to get it is probably going to be the ROM itself. I may use this with other games as well as soundracks aren't always available.
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    We do have some sound ripping threads but OK

    Sound on the DS can be stored in several ways but largely (even with region dupes I do not think we are over 30 roms yet that use things other than SDAT) it is stored in sdat files (more on other formats later).
    These sdat files can be anywhere in the rom but usually they are either in the root data directory, a directory called sound/music/snd or something like that or in a multi5 game they can be in the localisation directories.
    As you only need this file you can use something like crystaltile2 or a more simple application like ndsts:
    http://www.no-intro.org/tools.htm (file browser tab)
    That is the most simple method but not the most efficient- if you can parse the header you can find the sdat file or you can just unpack the entire rom with ndstool and either search for the big files (sdat files are usually several megabytes or even the bulk of the rom) or just the sdat extension.

    Although it was not asked for it does need to be mentioned, the SDAT format houses 3 main types of files (along with a few more hangers on to allow the other formats to work)
    1) SSEQ- the most common. Somewhat analogous to midi although that comparison falls over as midi will tend to have a predefined set of instruments (why midi may sound different between operating systems, devices and all the things in between) while SSEQ can use different ones in every game.
    2) STRM- long streams of (AD)PCM audio usually for whole songs and the like.
    3) SWAR- samples for various things, sometimes bundles of them. (AD)PCM here.
    More on the SDAT format:

    Once you have your file you have a few options to convert to more common formats (I do not know of much work on making a playback method like NSF).
    NDSSNDEXT: http://www.4shared.com/file/68276816/80922...sndext_v04.html
    VGMtrans: http://www.4shared.com/file/76520093/5a299676/VGMTrans.html
    crystaltile2 does have sound capabilities but they are a bit broken in the older versions and I have not tried the newer ones.
    low lines console tool: http://www.romhacking.net/forum/index.php/topic,8407.60.html (the thread alone is worth reading for aspiring rom hackers).

    With the possible exception of the last tool linked as SSEQ and

    Exceptions- surprisingly they can actually make life easier.
    6 examples
    Electroplankton- uses windows compatible wave files for the samples.
    N+- uses PCM audio (can be read with something like audacity or anything that allows raw audio import.
    Several games (most notably the world ends with you)- use the old cri format ADX (sometimes known as AHX) usually seen in stuff like the dreamcast and PS2. Several tools from that era still exist so use them.
    Tony Hawks skateboarding- uses a subformat of the SDAT "spec" but leaves it floating around inside the rom.
    A different kind of example is when a rom might have the sound buried in a sub format. Very rare though.
    There may be other formats as well- most people only tackle the popular games, I just pulled apart El Tigre: Make My Mule and it looks to either be an example of the packing or or even a new format entirely.

    Option 2 is use an emulator or a male male loopback 3.5mm cable. If you have a SDAT file you can hack it to play a given sound that you want (and remove the overlaying sounds if you want):
    The other formats mentioned can be hacked simply by relinking or removing (or if you want a crude method copying and renaming) the files you do not want to rip in that session.