DSHack

Archive Generated December 23rd, 2018
[TUTORIAL] How to add custom sfx (Voices , race sounds , etc.)
Author Posted on 2017/02/18
#2990
Swiftie Luma Hello , it's Swiftie :rosalina:

Today , i am here show you how to add your custom sound effects into the game such as voices for the characters and various sounds you hear in the game that are not music.

Also it is worth noting that this method works for some other games , aside from Mario Kart 7.

Let's Begin

What do you need?

- Your ROMFS folder from the game , in this case Mario Kart 7.
- 3DS Audio Ripper
- Audacity
- Hex editor , better if it is HxD
- Your Custom sounds in WAV format
- ROMFS Builder.
- HANS installed in your 3DS (loaded via Homebrew Launcher)
- Foobar2000 installed (with vgmstream component to play BCWAV files)
- ctr_WaveConverter32 ***

*** IMPORTANT

This is a Nintendo tool , so it's not possible to share in here or for the public so you need to find it yourself (However it's not hard to find)

Process

0- Install Foobar2000 WITH THE VGMSTREAM COMPONENT , this allows you to play the sounds in the bcwav format. Also install Audacity (this is a sound software) , which is free so it should be quick


1- Obtain your ROMFS folder.

This is very easy to do , and i wont go into much detail as you can find how to do this in this tutorial section

https://www.dshack.org/forum.php?page=thread&tid=109

2- After you get your ROMFS folder you need to find the .bcsar file which contains the SFX of the game.

The name of this file varies from game to game and also there can be more than 1 of these depending on the game , however the extention (.bcsar) remains the same , so they should not be hard to find.

For Mario Kart 7 , there's only 1 (ctr_dash.bcsar) and it contains most (if not all) of the games SFX as well as character voices , so it's very easy in this case.



3- Once you locate the file , open 3DS Audio ripper.

The files that you need are in bcwav format , so you only need to check the first option box , that says CWAV (CTR Wave)



Once you have done that , click on the save location and select the place where you want the folder to be.

Open Source file and select the ctr_dash.bcsar that you located inside the ROMFS of MK7.

now click on Process File.

By now , you should have a folder called BCWAV in the saved location as well as a notification of how many files you have extracted.

4- Go inside the folder and you should have many files with names such as 0x987882 , and etc.

These are the sounds of the game that you have extracted.

Play them on Foobar2000 to locate the sound or sounds you want to replace.

This can take a while because there are many sounds and there's not really an exact pattern on how they are arranged.

I advice to copy them in a different folder after you locate them , so they are already separated from the bunch that you don't really need.

5- Convert your custom sound from WAV to BCWAV.

But before doing so you must do this first:

Once you have your sounds separated from the others you dont want , you need to convert them into WAV files.

To do so , play them in foobar2000 and right click on them. Click on convert > quick convert and select WAV.



You should have then your sound in BCWAV format converted to WAV.

This is important because you need to make your custom sound MATCH in lengh with the original , or have it be shorter.

YOUR CUSTOM SOUND CANNOT BE LONGER THAN THE ORIGINAL OR THIS WILL NOT WORK AT ALL

So make sure your custom sound is the same lengh , or shorter than the original one.

In here my custom sound is on the bottom and it's shorter , so it should be no problem.



Also check on the sample rate of the original in the bottom left corner.

Your custom Sound should also match in sample rate , it can be the same or lower. if it doesn't just change the number to match the original or make it lower.

Remember than the lower the sample rate is , the lower the quality will be , so don't play with this too much , just make it the same as the original or a bit lower.

After you check on this , and make whatever edits you want (if you need) , save the sound as WAV.

Now time to convert it to BCWAV.

Put your custom WAV in the same folder as ctr_WaveConverter32 , and just drag the sound into the ctr_WaveConverter32 file and wait for it to convert.

Now you will have your custom sound in BCWAV format. You can play it on Foobar2000 just to check if it's all correct.

6- Open your Hex editor.

I will use HXD as i adviced.

Open the .bcsar file that contains all the sounds with it.

Now open the original BCWAV file that you want to replace in another tab

Finally open your custom BCWAV in another tab.



OK , so this part is rather easy but it's really annoying when you are doing voice mods because you need to do this WITH ALL THE CLIPS.

Good luck with that , lol ♥

So now , in the .bcsar tab hit Ctrl+G which triggers the ''go to'' option (you can also click on search and do it manually)

type the numbers of the original file name , but don't put the ''0x''



To make sure you did it correctly , you should have located the CWAV.

After this , go to the next tab , which is the original sound , and click Ctrl+A which is to select All , (and this can be done manually too).

Take note of the ''length'' of this file which is displayed on the bottom tab.



now go to the next tab , which is the custom sound and do the same.



Now open the Calculator of your PC.

You need to use it in HEX mode.

Type the length of the original sound , and got back to the .bcsar file

press Ctrl+E which triggers the ''Select Block'' function.

Click on length and type the same number as in the calculator , which should be the length of the original file.



Now go the custom sound tab and check the length.

Now you need to substract that number from the original sound length number.



This is why you need your custom sounds to be smaller or the same in size , as before , so this can work in here.

The result number should be displayed in the calculator.

After that go to the very end of the custom sound and put the cursor on the very last number.

Now click on the tabs above and click on ''Insert bytes''



type in here the result of your calculator. You have added the bytes (all of the 0) to this file , so it's the same as the original and match perfectly in the game.



Now select all of this with Ctrl+A and you will notice the length of the custom sound is now the same of the original in the previous tab.

Copy you all of the selection with Ctrl+C and go to the bcsar tab

With all in place go to Edit and click on Paste Insert.

Now save that file and you have Successfuly replaced the sound.

Finally , replace the original .bcsar of the ROMFS with the one you edited.

Sometimes a .bak file will be added when you edit the files with HxD ... DONT INCLUDE THIS ON THE ROMFS FOLDER , just delete it.

After that , repack your ROMFS with ROMFS Builder and load it via HANS.


The result is this ( this is not Mario Kart 7 , but you get the idea , and also proof it works in other games)



Hope this tutorial is useful to you and see you next time!

Credit for the idea of this tutorial goes to:

RosaliinaDaHacker64

He created his own tutorial for this , you can check it here.


The main difference here , is that he used YATA+ to make this work , but you really don't need it.

I have discovered that YATA+ makes your sound have LOWER quality no matter if you edit the settings and etc , it will always have LOWER quality than the ones in the original games.

So i strongly advice to use my method , but if you have any doubt , you can follow the video in here , just don't use YATA+ because it's really not necessary.
Author Posted on 2017/07/27
#3434
Endromonus Hi, um do you know what the sound for the race music is? (Example : Bowser's Castle = STRM_CN_KOOPA_CASTLE_N(or F))
Author Posted on 2017/07/28
#3435
PabloMK7
race music

What is the "race music"?
Author Posted on 2017/08/06
#3444
Endromonus @PabloMK7
The "race music," is the music you hear when racing in a track. Like how in Toad Circuit your going to hear the Toad Circuit theme.
Author Posted on 2017/08/06
#3445
PabloMK7
@PabloMK7
The "race music," is the music you hear when racing in a track. Like how in Toad Circuit your going to hear the Toad Circuit theme.

I still don't understand your question. Do you mean you want which tracks correspond to which music files? In that case you only have to look inside the romfs.