Importing Music - Kizari/Flagrum GitHub Wiki

Table of Contents

Prerequisites

This guide will walk you through the steps required for importing your own custom music (.mab file) along with proper looping into Final Fantasy XV Windows Edition. before proceeding to the next section, make sure to download and install the tools that are listed under the Required tools sub section.

Required tools

Locating an existing music file

  1. Extract the file that you would have downloaded from the AudioMog tool's releases page. as of writing this guide, the file should be called Release.zip and you can extract this file using 7zip or WinRar software.

  2. You will need to get an existing track which we have to use as the base, to add in our custom track into the game. for this example, we will use the music file "bgm_gs1.win.mab" located in the following directory inside your game's root folder: datas\sound\resources\20001music2\jp\

  3. Take a backup of this music file somewhere and then drag and drop the music file onto the AudioMog.exe file. this should open a command prompt window and should extract the music track(s) stored in this music file, into a folder. the music file name will be the name of the folder and there will be a _Project appended at the end of the folder name. for the music file that you just extracted here, you should get a folder called bgm_gs1.win_Project.

  4. Inside this extracted folder, you should find two .wav files. the first file is the one that you need to replace and so take note of the filename which would be bgm_gs1.win_000.

Looping your custom music file

  1. Install audacity if you haven't already and open the app after its done installing. then in the app's top left corner, click on File option, then Import and then select the Audio... option. this should open a small window in which you have to locate your custom music file.

  2. Once you have located and opened the file inside audacity, click on the same File option as before and this time select the Export option. then select the Export as WAV option and this should bring in a small window in which you have to specify the path where you want to store the WAV file.

  3. In the bottom of this small window, ensure that the Encoding is set to Signed 16-bit PCM and after you are done selecting a path and name for your WAV file, click on the Save button to save the file.

  4. After audacity has finished exporting the audio, click on the File option and select the Close option. this will bring in a dialog box asking whether to save the project before closing. select the No option and this will empty the project window.

  5. Now click on the same set of options that you had used before to import in the audio i.e File>Import>Audio... and in the small window that opens, select your converted WAV music file that you have exported and saved from the previous step. this will open the file in audacity.

  6. Change the Time toolbar to display samples. img_2

7. You can now start testing out loop points with the audio file. to get an idea on how this process works with audacity, I will give a short explanation on some of the UI components required for this process. you can skip this and go to Step 8 if you are already familiar with using audacity.

  • If you click on the Play button, you will see the Seek bar that would move as the music is being played. this would indicate the area or part of the music that is being played and if you click on the Stop button, this bar disappears. also notice how the Time toolbar displays and updates the samples constantly as the music is playing. it resets to zero if we click on the Stop button. Playback preview: img_3

  • We will need to use this seek bar as a guide for us to mark the area from where you want the music to begin repeating after it has played once. for getting the seek bar to not disappear, we will need to use the Pause button instead of the Stop button as the former will keep the cursor frozen in place when the music is not playing. this button will also freeze the sample value too in the Time Toolbar and so with this you can see what sample you are at when the music is paused.

  • When paused or during playback, try clicking on the blue color waveform with the I cursor and you will see another bar appear. this is the start position cursor and if you want to make the music start from a specific area inside audacity, then you can use this cursor to make the music start from that area after it has finished playing.

  • This is the Timeline area (highlighted) inside which you can click, to quickly jump through parts of the music when it is playing. Timeline preview: img_4

  1. Once you are familiar with these UI components in audacity, we shall now proceed to setting up a loop point. play your music file in audacity and try to identify an part or area where the music should start from, after it has finished playing. once you have located it, click on the waveform of that area for the start position cursor to appear and then stop playing the music.

  2. The sample value of the music at that particular area should appear in the Time toolbar and this sample value would be the loop point. make a note of this sample value somewhere as you will be using this in another software in the next section.

Finishing steps

  1. Now that you have a loop point, you would now need to use Wavosaur to mark the loop point on your custom music file. make sure to extract the zip file that you would have gotten from the Wavosaur download page and open the application.

  2. Click on the File option and select Open.... . this should open a small window in which you have to locate your custom music file.

  3. Once you have located and opened the file inside Wavosaur, press the L key on your keyboard and this should mark in two loop points for your track.

  4. Click on the Tools option and select Loop. then select the Properties option and this should open the Loop properties window. img_5

  5. In the Properties window and inside the Start sample box, type in the sample value that you made a note of from audacity. once you are done typing, click on the OK button to close the properties window and then press the Ctrl and S keys together on your keyboard, to save the loop point inside your custom music file.

  6. Remember the bgm_gs1.win_000 filename that you took note off from the bgm_gs1.win_Project folder ? You will now need to rename your custom music file to be the same name as that file. rename your file with this filename and copy it inside the bgm_gs1.win_Project folder. you will be prompted by windows whether to replace the file or not as both the original file and your custom music file share the same name. so allow the original file to be replaced by your custom music file.

  7. We are almost done. now come back to the folder where the AudioMog.exe file is present and in the location bar, type in cmd. press the Enter key after typing and a command prompt should open up. Screenshot 2023-08-08 211304

  8. In Command Prompt, type in AudioMog.exe "bgm_gs1.win_Project\RebuildSettings.json". basically we are running the AudioMog tool with the RebuildSettings.json file that is present inside the folder where you had copied in the custom music file. It should look like something like this once you have finished typing: Screenshot 2023-08-08 211858

  9. Press the Enter key and AudioMog should begin the repacking process. once its done repacking, close the command prompt window and go into the bgm_gs1.win_Project folder. here you will see a new "bgm_gs1.win.mab" file and this will be your custom music file ready for use ingame.

  10. And that's it. you can now copy this file inside the datas\sound\resources\20001music2\jp\ directory that can be accessed from your game's root folder.

Optional Section

This section should help in adjusting the volume level of your custom music file ingame, if in case the default volume level is not loud enough for this music ingame. you will require an hex editing software and I would recommend using 010 editor for this task. you are free to use other hex editing softwares too like HxD or IMHex, if you are familiar with hex editing.

  1. Once you have 010 editor installed, open your converted .mab file inside it. image

  2. Press Ctrl and the G key together and type 0x98.

  3. Once we are at position 0x98, we will need to see the float representation of the four hexadecimal values in the Inspector tab. you can see this highlighted in the image: image

  4. The float values for the volume ingame range between 0.00 to 1.00, with the values closer to 0.00 being the lowest and the values closer to 1.00 being the loudest. for this music file, the volume is 0.19.

  5. Try setting this float value to 1.00 which would make the volume of the music file loud ingame. to do this, you just have to double click on the value in the float column on the Inspector tab and once its highlighted type in 1.00. image

  6. Once you have typed in the value, press the Ctrl and S keys together on your keyboard to save the changes. this way you can adjust the volume levels of your custom music file when its played ingame.