Creating Audio Files
Prerequisites
Section titled “Prerequisites”To create audio files for Persona 4 Golden (PC), you will need the following at minimum:
- The audio file you’re adding in WAV format
- If your file is not a WAV, you’ll want to convert it using FFmpeg (this can be installed for Audacity following these instructions)
- Yona
To loop audio files (for music or repeating SFX, etc.), you will need the following:
- PyMusicLooper - to automatically find loop points
- Prerequisite: Python (64-bit) >= 3.10
- Audacity - to manually find loop points or for other basic audio editing
Audio Editing
Section titled “Audio Editing”Music and certain sound effects use loops defined within the data of the audio files, so they will continuously play as long as they are being called/used. These need to be set up so that the audio file will repeat correctly.
If you are editing an audio file that requires looping, read Looping Audio. Otherwise, skip to Converting Audio
Looping Audio
Section titled “Looping Audio”If your audio file requires loops, you will need to find and set up loop points, which tell the audio where to start looping again. In some cases, this is as simple as finding start and end loop points, and in other cases, more advanced audio editing needs to be done in order to ensure a clean sounding loop. Generally, video game songs tend to be composed with looping in mind, but other songs may be more difficult to loop.
There are three ways to get loop points depending on your use case. In most cases, you will want to automatically find loop points using PyMusicLooper. In some cases, you may need to manually find loop points. In other cases, you may simply need to loop the entire file from start to end. These methods are detailed below.
The simplest way to get loop points is to use PyMusicLooper to automatically find optimal loop points. PyMusicLooper is a command-line interface (CLI) program, which means you have to run it by directly inputting commands into a terminal rather than using a GUI like with many other programs.
Open a terminal in the same spot as your audio files (either command prompt or Powershell). Type in the following command: pymusiclooper --samples -i play --path <audio file>
The program will take a few seconds to process the audio file and try to find the best loop, then it will output the following:
The best loop points that the program has found are displayed in the output. As shown at the bottom of the output, you can select a loop by typing in its index number, and by appending p
, you can preview the loop to make sure it sounds good before selecting it.
Generally, the lower the index, the better the loop will be, but make sure the loop captures the entire segment of the song you want; as long as the score is high enough (>95%), the loop will generally sound fine.
Once you’ve found a loop you like, save the loop start and loop end values; you will use them when converting your audio in the next section.
In some cases, manual looping may be necessary or desirable. For example, PyMusicLooper may not give you a desirable loop, you might need to do some audio editing to create a decent loop, etc.
To do this, open your replacement audio file in Audacity. Select the start and end of the section of song you want to loop, then set the selection toolbar (at the bottom of the screen) to “Start and End of Selection” with the time displayed as samples.
With newer versions of Audacity, you can preview the loop by clicking the Enable Loop button. If using an older version of Audacity, click the Play button or somewhere on the timeline while holding Shift
.
Save these loop points; you will use them when converting your audio in the next section.
For a simple loop where you loop from the very start to the very end of the audio file, you do not need to find the specific loop points; you can automatically create this loop when converting your file by not specifying loop points in Yona. Skip to the next section for more details.