I've noticed quite a number of people who either don't loop the music in their levels properly, or don't know how. Thankfully, this guide is here to teach you exactly what you need to do to make your music loop like it should!
You will need:
- a forked copy of Audacity
- the audio file you wish to use as your bgm
- SLADE (duh!)
Why Forked?
Very recently (as in, a few days ago recently) an update was pushed that introduced numerous privacy policy changes that give them the right to collect your user data and then sell it to "third-parties". In other words, it's now spyware. Luckily, because Audacity is open-source software, a fork has been made that lacks this data collection. The link above contains instructions on how build your own forked copy so you can safely use the program. Additionally, if you already have a copy of Audacity installed, then you should be completely fine, as long as it is not version 3.0 or higher.
Step 1: Open up Audacity and import the audio file you want to use. Simple enough. Just make sure you installed a safe version!
Step 2: If you got the audio file from somewhere online, chances are that the music fades out at the end. If this is the case, then we want remove it from the timeline, since the song will only loop once it reaches the end of the track and we want it to be seamless. You can theoretically cut it off at any point near the end, however I find it most useful to cut it at the beginning of a given section of the track since it makes the following steps in the process easier.
Step 2.5: If the track itself loops multiple times, then you can cut out the extra loops as well. It's not necessary, but it helps reduce filesize!
Step 3: Highlight the part of the track you want to be looped by dragging your mouse across the timeline. The highlighted section should begin where the end of the track leaves off. To give you an idea of where that would be, consider the highlighted section to be its own song (ignoring the actual intro) that should loop seamlessly. On the off-chance you need to zoom in and out to fine-tune your selection, you can do just that by holding the Ctrl key in tandem with your mouse's scroll wheel.
Step 4: Test the loop by choosing the Effect > Repeat option up top. don't fiddle with any of the settings, just leave it at 1.
Now, playback the audio around where the track is repeated and see how it sounds. If it sounds good, then congratulations! You can move on to step 5. If not, then stop playback and press Ctrl+Z to undo the Repeat effect. From there you will need to adjust your selection from Step 3 and then repeat Step 4 until you can get the loop to sound seamless.
To speed up the process, you can press Ctrl+R to repeat the last used effect, which in this case is Repeat! Adjust as necessary until you can get it to sound good.
Step 5: Convert the music timer into milliseconds.* First, Ctrl+Z to undo your Repeat effect, if you haven't already (not doing this won't ruin anything, but again, file size!) Go to this timer here, click the drop-down tab, and select hh:mm:ss + milliseconds.
* Note that this is a 1-time step! When using Audacity in the future, it should remember that you set it to the milliseconds timer.
Step 6: Save the music file. Go to the drop-down tabs and choose File > Export > Export as OGG. Make sure the file name follows the naming conventions for OGGs, and that the the Quality slider is turned all the way down to 0.
Step 7: Enter the LOOPMS metadata tag. Firstly, when the following window pops up, press the Clear button to remove all the metadata information stored on the track, as it is not necessary for this file. Then, in the empty row, add a tag titled LOOPMS. The value for this tag should be the number displayed as the Start of your selection (minus the decimal).
Step 8: Insert into SLADE! Congratulations, now all you need to do is add your audio file to your WAD using SLADE. Make sure to include it in the MainCFG so it plays on the proper level. If you've followed all of these steps correctly then your music should be looping properly like never before!