Extracting sound effects from a Switch game A developer extracted sound effects from Nintendo Switch Sports by obtaining a dumped game file from torrent sites, bypassing the need for a modded Switch. The process involved navigating ad-ridden sites to find the game dump, then extracting the audio assets, including Golf sounds added in a later patch. Extracting sound effects from a Switch game As part of my previous post reverse engineering the Denon XML API https://blog.alexbeals.com/posts/automating-denon-avr-zones I talked about my love for the Golf sound effects in Nintendo Switch Sports, complete with a way to build an ambient soundscape /posts/automating-denon-avr-zones music-to-my-ears . But where did I get those sound files? There are in-game recordings on YouTube https://www.youtube.com/watch?v=f6 ub4MUWHE but the sounds are all muddled together, and separating them out is a bit of a nightmare. 1 Though software like demucs https://github.com/facebookresearch/demucs keeps making it easier. So where and how do I get them? Put on your ~~pirate's hat~~ caving helmet. 2 It's a little sickening that there's no such product on the market or in Google Images — not even a custom Spelunky https://en.wikipedia.org/wiki/Spelunky skin?? . Also every vintage miner's helmet that I looked up to Photoshop was AI generated. In lieu of low-background steel https://lowbackgroundsteel.ai/ , here's some slop straight from the ChatGPT furnaces. It's time to go ~~thieving~~ spelunking. .xci and .nsp and .nca , oh my My approach is, as the title spoiled, to extract the sound assets from the raw Switch Sports game file. To do that we need the game file. To dump the game file we need a modded Switch. To mod the Switch we either need unpatched hardware you can check your serial number here https://ismyswitchpatched.com/serial-check , though my prefix of XAW1 is unfortunately patched 012412 3 There used to be a hardware exploit using a memory buffer overflow in the Tegra's pre-boot mode https://switch.hacks.guide/user guide/rcm/ . or solder on a modchip https://www.youtube.com/watch?v=zX7eBg2gIzI . RP2040 Picofly modchip https://wayayeo.org/product/rp2040-picofly-switch-modchip/ That all seems like a lot of work. Alternatively, other people have already done this, albeit often to illegally distribute the dumped games for Switch emulators like Yuzu https://www.gamesindustry.biz/nintendo-issues-dmca-takedown-notice-against-over-8500-yuzu-emulator-repositories or Ryujinx https://gbatemp.net/threads/ryujinx-emulator-taken-down-after-devs-reach-agreement-with-nintendo.661497/ . Both emulators are now gone as part of the deluge of copyright strikes by Nintendo, but the dumped games are still out there. 4 I'm soooo subtle. I advise making sure you own a copy of the game before following this path. Finding them requires searching through torrent s of ad-ridden sites that try to leech your money and time with fake links, but if you follow the breadcrumbs 5 It's fun that this term has caught on for navigation when it explicitly failed in Hansel and Gretel : the birds ate them Use the white pebbles Though saying it's from Hansel and Gretel isn't exactly right: that was published in 1812 and it's just a tweak of Nennillo e Nennella in Basile's 1636 Pentamerone where it's bran https://www.worldoftales.com/European folktales/Italian folktale 30.html gsc.tab=0:~:text=When%20Nennillo%20and%20Nennella%20had%20eaten%20all,bran%20that%20was%20strewn%20upon%20the%20ground , though that pulls from Montanus's 1557 The Little Earth-Cow , where it's hemp seeds /images/extracting-sound-effects-from-a-switch-game/55.jpg , though that pulls from oral history likely dating back to Ariadne's thread and beyond — there are no original stories. you can find what you're looking for. In our case the base game isn't enough: Switch Sports only released with Tennis, Bowling, Chambara, 6 Chambara holds the dubious honor of being the only sport more recognizable inside Switch Sports than out of it: Soccer, Badminton, and Volleyball, with Golf not being added until v1.3.0 seven months later. While it seems like you should be able to extract the Golf sound files from just the v1.3.0 patch, Nintendo releases online patches as /images/extracting-sound-effects-from-a-switch-game/8.png .nsp 7 N intendo S ubmission P ackage, kind of like an .apk for Android. files, which are changesets against the base game rather than raw files. Therefore to extract the new sound files, we're going to need the v1.3.0 .nsp patch file and the v1.0 .xci 8 N X C ard I mage. I think. file a raw dump of the original physical cartridge . Notably though we don't need the updates in-between, as each patch is defined solely in reference to v1.0. Master keys for encrypted locks First we need to extract .nca 9 N intendo C ontent A rchives, kind of like a .zip file for Nintendo. files from both of the wrappers. They're encrypted, and decrypting them requires official Nintendo decryption keys that live on the Switch. These can ostensibly be pulled from a modded Switch using Lockpick https://github.com/shchmue/Lockpick RCM , though the repo has been taken down: it's easier to just find prod.keys lists online. These lists contain many keys, but for Switch Sports we just need header key and key area key application 0c for the base .xci , and titlekek 0c for the .nsp patch. 10 If you're curious why we only need the 0c suffixed keys, the firmware for the base game and updates is 13.3.4.0, which just uses Master Key 0xC you can use hactool -i -k prod.keys file.xci to find that, though it's a little chicken-and-egg : Most /images/extracting-sound-effects-from-a-switch-game/6.png prod.keys lists have all firmware keys so this is mostly irrelevant. search files and repos https://github.com/THZoria/NX Firmware/blob/a9e20653cf8ff1dc350b18340b2a788e1cc3cf08/prod.keys L32 for these substrings Once you have these, the easiest tool I found to decrypt the files was NxFileViewer v3.0.2 https://github.com/Myster-Tee/NxFileViewer/releases/tag/3.0.2 . 11 Note that from here on out all the tooling I'm using is on Windows. Some of it may exist on macOS I didn't verify but everything that's video gaming–adjacent is still Windows first, even as the brand slides into decay. First you drag-and-drop your prod.keys file, and then you can drop in the .xci or .nsp you want to explore. For the .xci we're looking for the main .nca file under "Secure": it should be the biggest file and have the Program suffix. Right-click and save it as a raw file to export. find software to handle https://github.com/LordNed/BFRES-Extractor , not .bfres .bkres . fff189342ce634d6f5ee09f88a625204.nca . You can see the file structure even without exporting the .nca . Bowling models 12 We can do the same thing for the .nsp update file though because it's a patch it shows an unexpandable "Section 1" instead of the file structure . In order to combine them we'll again need to export the Program -suffixed .nca file, 0dea81236257713f3c7e1dcec6a48893.nca , though this time we also need the AccessKey from the Ticket .tik file 6DFD41E888641F694AF33F03F2E57C01 . Phew With all of this pulled together we're finally ready to extract. Extracting sound files We can download hactool version 1.4.0 from GitHub https://github.com/SciresM/hactool/releases/tag/1.4.0 , and then run it with the --romfsdir flag to extract using Command Prompt: hactool -k