Extract problem for early NDS game

TachyBunker

Member
OP
Newcomer
Joined
Sep 23, 2022
Messages
6
Trophies
0
Age
18
Location
⛥⸸ Neon-Montcuq ⸸⛥
Website
soundcloud.com
XP
26
Country
France
Hey, I recently extracted music and SFX from "Metroid Prime: Hunters", which has standard SDAT, STRM, SWAR, SSEQ, SBNK. But there is a second game, "Metroid Prime Hunters: First Hunt" (released the same day as Nintendo DS) which I am struggling to rip. Its architecture for the music is different in that there is no "sound_data.sdat".

I only found four BIN files (which I've attached) that I extracted from the sound folder with Tinke. However I have no idea which programs to use to decode them/extract files from them. Tried Magic Iso but it doesn't work, I imagine NDS uses special BIN archiving methods? Any help to get the music and SFX from those files?

Thank you for helping in advance! :D
 

Attachments

  • Metroid Prime - First Hunt sound bins.rar
    2.4 MB · Views: 45

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
bin is a generic extension used by a million different formats, often differing even within the same game, and default choice of a dev "just needing an extension to get it working".

As far as "standard" formats then most note Metroid Prime Hunters as being non standard -- it was early enough that its formats are at best prototype versions of the formats we all know and love from the DS SDK ( https://www.romhacking.net/documents/[469]nds_formats.htm http://problemkaputt.de/gbatek.htm#dsfileformats ).
There are some tools https://www.romhacking.net/utilities/1071/ and the old dsgraph program to view things though.

Anyway a quick scan with a hex editor reveals no great interesting aspects to that.
Importing sfxdata as raw audio into audacity with ADPCM settings (the DS has PCM and ADPCM native playback so those are the usual guesses. http://problemkaputt.de/gbatek.htm#dssound , frequencies also vary but don't always expect 44KHz and instead it is more like 17Khz to 22Khz, even dropping down to 12KHz at times, other settings vary and the bytes to skip also can be nice in audacity to dodge your eardrums being burst by it trying to interpret whatever setup data and header is at the start of the file) gets me a whole bunch of sound effects, BGMdata appears to be a background song.
Settings I might be able to determine if I look more but if it is just for ripping then might be instead worth loading up desmume with the game and seeing what settings the audio channels are using before matching those.
Similar positive results messing with the other files as well.

Looking at

00:00 Intro
00:21 Title Screen
02:53 Samus Appearance Jingle
02:57 Empty Corridor
03:45 Regulator - Brinstar
06:02 Survivor - Vs. Ridley
08:24 Morph Ball - Vs. Parasite Queen
10:25 Mission Results
11:25 Trooper Module - Celestial Archives Multiplayer (FH Version)
13:59 Ancient Vestige - Alinos Multiplayer (FH Version)
15:42 Metroid Prime Hunters Trailer
16:14 Game Over
16:19 Mission Failed
16:26 Mission Completed
The site it links back to says it was an emulator rip as well which is unfortunate.

There is no way this even 2 meg file is going to stretch to that (22050KHz which is about passable for music only gets you 3 minutes something) so I would wonder if there are not some kind of loop commands available and used in the game.

Might be worth seeing if you can find "Samus Appearance Jingle" in that file as being smaller it should have some rather different pointers to the rest of the file.
 

TachyBunker

Member
OP
Newcomer
Joined
Sep 23, 2022
Messages
6
Trophies
0
Age
18
Location
⛥⸸ Neon-Montcuq ⸸⛥
Website
soundcloud.com
XP
26
Country
France
bin is a generic extension used by a million different formats, often differing even within the same game, and default choice of a dev "just needing an extension to get it working".

As far as "standard" formats then most note Metroid Prime Hunters as being non standard -- it was early enough that its formats are at best prototype versions of the formats we all know and love from the DS SDK ( ).
There are some tools and the old dsgraph program to view things though.

Anyway a quick scan with a hex editor reveals no great interesting aspects to that.
Importing sfxdata as raw audio into audacity with ADPCM settings (the DS has PCM and ADPCM native playback so those are the usual guesses. , frequencies also vary but don't always expect 44KHz and instead it is more like 17Khz to 22Khz, even dropping down to 12KHz at times, other settings vary and the bytes to skip also can be nice in audacity to dodge your eardrums being burst by it trying to interpret whatever setup data and header is at the start of the file) gets me a whole bunch of sound effects, BGMdata appears to be a background song.
Settings I might be able to determine if I look more but if it is just for ripping then might be instead worth loading up desmume with the game and seeing what settings the audio channels are using before matching those.
Similar positive results messing with the other files as well.

Looking at

00:00 Intro
00:21 Title Screen
02:53 Samus Appearance Jingle
02:57 Empty Corridor
03:45 Regulator - Brinstar
06:02 Survivor - Vs. Ridley
08:24 Morph Ball - Vs. Parasite Queen
10:25 Mission Results
11:25 Trooper Module - Celestial Archives Multiplayer (FH Version)
13:59 Ancient Vestige - Alinos Multiplayer (FH Version)
15:42 Metroid Prime Hunters Trailer
16:14 Game Over
16:19 Mission Failed
16:26 Mission Completed
The site it links back to says it was an emulator rip as well which is unfortunate.

There is no way this even 2 meg file is going to stretch to that (22050KHz which is about passable for music only gets you 3 minutes something) so I would wonder if there are not some kind of loop commands available and used in the game.

Might be worth seeing if you can find "Samus Appearance Jingle" in that file as being smaller it should have some rather different pointers to the rest of the file.
Oh wow, yeah, importing with PCM or ADPCM works with Audacity. I am trying things out but I am only getting nightmarish noises out of those, probably because those aren't the right parameters. Have a clue beyond sample rate? I've tried 8 to 32 PCM, and the three APDCM types. The APDCM lowest seems to get rid of the noisy stuff, yet it is weird because even if i try 12k or 17k or 22k as sample rate it's still sped up. What should I do?
 
Last edited by TachyBunker,

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
You appear to have some different settings to me (I have the one ADPCM type, was on Linux for the stuff above)

Desmume does have a sound channel feature that says what frequency things are playing back at. That would be where I look to start with.
If you can get an example of playback (do remember you have cheats, savestates, turbo and more to get places) then you might be able to in turn divine where in the file any sample rates are indicated (possibly header, possibly before the individual tracks, I would be expecting a repeated selection of values as they are going to select from a bunch of obvious rates -- no A = whatever Hz nonsense and matching sample rates there). It could be a reference value for a prebaked list but it would be a first, could equally have been included in the binary and set accordingly.

Having another little look.
SFXDATA.bin
Ends at 0007 9F53
Back in the header bunch of values counting upwards after you flip them (4 bytes each) which usually means pointers.
0700 A00C is the last of them at 013E
0140 is the second value in the header which could be start of new section (though technically that is halfway through the value so might be end of section after the initial header value).

4F00 starts the header. That is 79 in decimal which is rather higher than the apparent file count if what those counting up values each represent a file for (about 60, one or two off being explained away easily enough but 19 is more than is plausible).

I might dump a list of those pointers and subtract one from the other (makes file sizes) or investigate the locations.

Indeed
Pointer​
Next pointer – current​
00000140​
CB8​
00000DF8​
2420​
00003218​
2EF0​
00006108​
2F50​
00009058​
2150​
0000B1A8​
311C​
0000E2C4​
16D4​
0000F998​
E14​
000107AC​
1104​
000118B0​
263C​
00013EEC​
1798​
00015684​
137C​
00016A00​
147C​
00017E7C​
11E4​
00019060​
1B04​
0001AB64​
1D9C​
0001C900​
528​
0001CE28​
1210​
0001E038​
1C​
0001E054​
1F5C​
0001FFB0​
19B4​
00021964​
84C​
000221B0​
156C​
0002371C​
1F5C​
00025678​
1E78​
000274F0​
1728​
00028C18​
47D4​
0002D3EC​
1C​
0002D408​
1C​
0002D424​
2DB4​
000301D8​
1EBC​
00032094​
1E60​
00033EF4​
1CF4​
00035BE8​
CDC​
000368C4​
78C​
00037050​
578​
000375C8​
1810​
00038DD8​
1818​
0003A5F0​
ECC​
0003B4BC​
23DC​
0003D898​
28F8​
00040190​
22AC​
0004243C​
2428​
00044864​
7B0​
00045014​
FCC​
00045FE0​
1C24​
00047C04​
EF0​
00048AF4​
DC0​
000498B4​
1C​
000498D0​
1C​
000498EC​
1C​
00049908​
1C​
00049924​
14E0​
0004AE04​
1384​
0004C188​
224C​
0004E3D4​
BDC​
0004EFB0​
4500​
000534B0​
2078​
00055528​
460C​
00059B34​
1E60​
0005B994​
456C​
0005FF00​
2A7C​
0006297C​
20D4​
00064A50​
1460​
00065EB0​
1A4C​
000678FC​
27DC​
0006A0D8​
2978​
0006CA50​
5D0​
0006D020​
DD4​
0006DDF4​
1C​
0006DE10​
253C​
0007034C​
23C8​
00072714​
18E0​
00073FF4​
11AC​
000751A0​
724​
000758C4​
463C​
00079F00​
1C​
00079F1C​
1C​
00079F38​

I have only done a handful at this point but the numbers at the pointer are usually only a few bytes different to the "size" values I calculated (for various purposes it can be easier to align sub parts of files and files in general to certain boundaries -- better to waste a few bytes here and there than spend several dozen cycles fetching and manipulating data. Alternatively that could be length of audio section and the remains being some kind of info (looping points, frequencies, bit depth, stereo-mono...). Could also be worth transplanting or fiddling with some section of data there and seeing what changes.
Doing the goto pointer, goto pointer+data at pointer does not have any particularly clear delineation (no mass of 00 before it or anything) but could be something.

The 1C length files might also be worth investigating.
 

TachyBunker

Member
OP
Newcomer
Joined
Sep 23, 2022
Messages
6
Trophies
0
Age
18
Location
⛥⸸ Neon-Montcuq ⸸⛥
Website
soundcloud.com
XP
26
Country
France
Here are the different formats i found with desmume:
32728.5 Hz 1 PCM16 - music
10909.5 Hz 1 PCM16 - music
7990.9 Hz 2 PCM8 - menu SFX
11017.1 Hz 2 PCM8
11017.1 Hz 2 IMA-ADPCM
11017.1 Hz 2
15989.5 Hz 2 PCM8
15989.5 Hz 2-IMA-ADPCM
14297.8 Hz 2 IMA-ADPCM - ingame SFX
I had close results with 7990.9 Hz 2 PCM8 on menu SFX but it's still not quite it. Any thought?
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
I assume the 1/2 numbers are channel count.

Anyway only real idea is there are potentially different flavours of ADPCM and whatever is baked into that is not working. The DS DAC is not good but it should not be that radically different here (granted my abilities here are probably as nothing compared to what your soundcloud link has/I am one of the furthest things from a golden ear you are likely to meet). In the case of SDAT SSEQ (the midi a like format) then the timing is potentially a bit off as it used a simpler means at the cost of accuracy (can crop up when people try inverting to blank sounds) but this should not be it/only come in during the loops.
I am still back at wanting to look at the data at the end of the sub files and seeing if they contain any info. If you have a rough idea from desmume and it is all a prebaked list of acceptable frequencies then something might jump out you.

Could be interesting to inject it into a suitable SDAT file (not all will have long form wave tracks, usually seen as STRM) along with tweaking the relevant settings and see what vgmtrans https://github.com/vgmtrans/vgmtrans , vgmtoolbox https://sourceforge.net/projects/vgmtoolbox/ (hope someone reupped the SDAT plugins/package somewhere) and https://www.romhacking.net/?page=ut...el=&perpage=20&title=&desc=SDAT&utilsearch=Go make of it if their PCM and ADPCM decoders are closer to hardware.

If you need a tool to slice up files I usually suggest filecutter
https://web.archive.org/web/20170218180937/http://min.midco.net/cracker/filecutter.zip
Between the simplicity of the file, a bit of fun in a hex editor and a spreadsheet program and you can make a batch file that will slice things up into individual files quite happily, possibly including the sub file "sizes" to have some further fun with. At least that is what I would be doing if I was not running off to go do things.
 

TachyBunker

Member
OP
Newcomer
Joined
Sep 23, 2022
Messages
6
Trophies
0
Age
18
Location
⛥⸸ Neon-Montcuq ⸸⛥
Website
soundcloud.com
XP
26
Country
France
Hey, thanks for all your help! I managed to extract the audio. For anyone in the future who wishes to get an original audio gamerip from Metroid Prime Hunters First Hunt, here they are.
 

Attachments

  • Metroid First Hunter Gamerip_p1.rar
    6.5 MB · Views: 33
  • Metroid First Hunter Gamerip_p2.rar
    7 MB · Views: 40

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: I did use a bot for Diablo III though but no ban there lol