Extracting sound effects from a Switch game

As part of my previous post reverse engineering the Denon XML API I talked about my love for the Golf sound effects in Nintendo Switch Sports, complete with a way to build an ambient soundscape. But where did I get those sound files? There are in-game recordings on YouTube but the sounds are all muddled together, and separating them out is a bit of a nightmare. 1 Though software like 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 skin??). Also every vintage miner's helmet that I looked up to Photoshop was AI generated. In lieu of low-background steel, 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, though my prefix of XAW1012412 is unfortunately patched 3 There used to be a hardware exploit using a memory buffer overflow in the Tegra's pre-boot mode. ) or solder on a modchip.

Switch internals, complete with an installed RP2040 Picofly 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 or Ryujinx. 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 torrents 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, though that pulls from Montanus's 1557 The Little Earth-Cow, where it's hemp seeds, 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 .nsp 7 Nintendo Submission Package, 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 NX Card Image. 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 Nintendo Content Archives, 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, 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 prod.keys lists have all firmware keys so this is mostly irrelevant.

They're everywhere on GitHub if you search files and repos for these substrings

Once you have these, the easiest tool I found to decrypt the files was NxFileViewer v3.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.

I don't know how to convert these: I could only find software to handle .bfres, not .bkres.
Right-clicking the 1.48GiB one, 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, and then run it with the --romfsdir flag to extract using Command Prompt:

hactool -k <prod.keys> --basenca=<v1.0.nca> --romfsdir=<output_dir> <v1.3.0.nca> --titlekey <AccessKey>

In my case with hard data that looks like this: 13 You can safely rename the .nca files: the hexadecimal name isn't necessary. I'm not sure if the titlekey needs to be lowercase.

hactool.exe -k prod.keys --basenca=fff189342ce634d6f5ee09f88a625204.nca --romfsdir="D:\Desktop\Switch Sports Golf Extraction\romfs_3" "0dea81236257713f3c7e1dcec6a48893.nca" --titlekey 6dfd41e888641f694af33f03f2e57c01

In the output directory that you choose, navigate to Sound/Resource. There's two main types of files here: raw .bwavs in the Stream folder and compressed .bwav sets as .bars.zs.

To extract the .bars.zs file I used BARSReaderGUI v1.0.1, which has a "Batch Extract" option. Just select the overall Sound/Resource folder and it decompresses all subfiles.

And voila, everything's converted into .bwav! This is just a normal 14 "Normal? What do you know about normal? What does anyone in this family know about normal?!" sound file, which you can play using v2.25.9 of foobar2000 with the vgmstreamdecoder plugin component. You can also export them as .wav or .mp3 or countless other formats:

Take a listen:

Filename (.bwav)SoundDescription
SE_Glf_Swing_Iron_PowerOverThe sound from overswinging an Iron club
SE_Glf_Env_Pond_01Pond ambient noise
SE_Glf_Env_WaterFall_01Waterfall ambient noise

The Sportsmates speak Minionese??

Most of the audio files are for the ball, the swings, or the ambient sounds, which I expected. What I didn't expect were the files like SE_Glf_Env_Walla_MiddleMale_07.bwav that make up the crowd's background talking noise (Nintendo certainly never expected you to hear that audio this clearly). Click on a Sportsmate to hear their Golf environmental "dialogue"! 15 Big shoutout to this polygon-backed image map generator for making the clickable image possible, and an even bigger shoutout to the voice actors for making up nonsense syllables!

Congrats on making it to the end! I couldn't find good resources on how to do this, so hopefully this guide is helpful for others trying to extract Switch game assets (and ideally it's engaging even if you're not). Regardless of which bucket you fall in, give yourself a round of applause, listen to some tunes, and maybe thank the sound team: 16 Did I extract the exact font from the credits following this guide, use SARC-Tool to extract the bfotf files from Font.Nin_NX_NVN.bfarc, and use NintyFont to convert to .ttf? Along with extracting the credits video? All just to have custom sound-specific credits? Sure did. Even made a version of the easter egg!

Sound Director Natsuko Yokoyama Sound Programming Sohei Hirai Music Haruko Torii Takuhiro Honda Sound Design Riyu Tamura Nobuyuki Sakai NOA Audio Engineer Steven A. Williams Sound Support Toru Minegishi Takahiro Watanabe Masato Mizuta

  1. Though software like demucs keeps making it easier. ↩︎

  2. It's a little sickening that there's no such product on the market (or in Google Images — not even a custom Spelunky skin??). Also every vintage miner's helmet that I looked up to Photoshop was AI generated. In lieu of low-background steel, here's some slop straight from the ChatGPT furnaces. ↩︎

  3. There used to be a hardware exploit using a memory buffer overflow in the Tegra's pre-boot mode↩︎

  4. I'm soooo subtle. I advise making sure you own a copy of the game before following this path. ↩︎

  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, though that pulls from Montanus's 1557 The Little Earth-Cow, where it's hemp seeds, though that pulls from oral history likely dating back to Ariadne's thread and beyond — there are no original stories. ↩︎

  6. Chambara holds the dubious honor of being the only sport more recognizable inside Switch Sports than out of it:  ↩︎

  7. Nintendo Submission Package, kind of like an .apk for Android. ↩︎

  8. NX Card Image. I think. ↩︎

  9. Nintendo Content Archives, kind of like a .zip file for Nintendo. ↩︎

  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 prod.keys lists have all firmware keys so this is mostly irrelevant. ↩︎

  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. ↩︎

  12. I don't know how to convert these: I could only find software to handle .bfres, not .bkres. ↩︎

  13. You can safely rename the .nca files: the hexadecimal name isn't necessary. I'm not sure if the titlekey needs to be lowercase. ↩︎

  14. "Normal? What do you know about normal? What does anyone in this family know about normal?!" ↩︎

  15. Big shoutout to this polygon-backed image map generator for making the clickable image possible, and an even bigger shoutout to the voice actors for making up nonsense syllables! ↩︎

  16. Did I extract the exact font from the credits following this guide, use SARC-Tool to extract the bfotf files from Font.Nin_NX_NVN.bfarc, and use NintyFont to convert to .ttf? Along with extracting the credits video? All just to have custom sound-specific credits? Sure did. Even made a version of the easter egg↩︎