LEGO Racers Custom Audio Tutorial

Table of Contents
History Directions Video


Hello Blog-O-Sphere! A few weeks ago, I figured out how to create custom music in one of the few video games that I own, LEGO Racers (Created by High Voltage Software in 1999, AKA LR & LR1)!

The tutorial itself is not that long, but I want to share how I figured it out.

Back on April 25 of 2010, user bartvbl posted on Rock Raiders how to import the .TUN files. I will quote him:

Ok. I found the right way to import the RAW data now:

1. Open Audacity, and clock project > import raw data

2. Select VOX ADPCM

3. You can play a bit with the endian options, but they don’t seem to do much

4. Click import

Now the only problem is that the music is too loud for audacity, making it still sound a bit strange.

This post was written almost a year and a half before I came along and began expounding on his research.

Around October 2, 2011 I started on my hunt for a convertor for .TUN files. I found out that is no such audio file. The file type had actually been known since bartvbl made that post: VOX. The LEGO Racers music is actually VOX audio with a TUN extension.

I soon found a command-line program that was able to convert normal (MP3, WAV, such like that) to VOX, namely, Sound eXchange (SoX).
I found a piece of music that I liked, and converted it. I sapped it in the game files, and gave it the proper name. I loaded the game, and the music played. But it was really low in volume, and it was really, really slow.

I figured out that the file hertz was what made the file slow. I raised it, converted the music, and loaded the game again. This time, it was even slower. I lowered the hertz next, and to my surprise, the music went faster! I finally found the right hertz after a few more tries.

During this process, I discovered an interesting… issue, for lack of a better word. The higher the hertz of your custom music, the slower it will play in game. The lower the hertz, the faster the music will play.

The real music was produced at 44100 Hz, and it plays at the correct speed in Audacity when imported However, the custom music has to be produced at 22050 Hz to play correctly in-game.

Once I figured that out, I started working on the volume. I said earlier that my music was way too low in volume in-game. Combined with the fact that the official music was loud in raw form, I deduced out that the game lowers the volume of the music.

I tried amplifying the music in Audacity, but every time I did that, I got an error from the SoX that it was really loud, and that it lowered the volume. When that file was put in-game, the audio volume would be in flux: It would be loud for a second, then low for a while, the loud again. I found out that the convertor lowered the really loud parts, and the lower parts that were not too loud, it left alone.
I tried to amplify the music using the tools built into SoX, but that did not work. Amplifying in both Audacity and SoX did not work either. The result was the same: the music volume was in flux.

rioforce (my brother) had been watching me every now and then, and of course I told him what was going on and what was happening.. He said he might know what was going on.
The raw files, are very load when imported but, the waveforms are all the same: flat on top and bottom.

rioforce suggested this: Amplify the music, normalize it, then export the file and convert it. I did that, and the results were better than what I was doing before. SoX did not give me an error, and the music was not in flux in-game.

I figured out a SoX command so the amplified music would not be clipped when being converted. Using that command, I got good results too, though not as good as amplifying then normalizing. In addition, with the command, the converted music was not distorted in-game, unlike the other method.

In the end, I chose to use the command over the amplifying and normalizing. After being amplified and normalized, some of the music I choose was back to its original volume, and completely wiped out my changes.

Fast-forward to the third week of February 2012. I had found out the month before that Audacity could export VOX files in addition to importing them, but it was very flaky. Sometimes it worked, sometimes it didn’t. I had decided to wait for the next release of Audacity to update this tutorial to use only Audacity. But Audacity updates were spread far out, and I didn’t really want to wait for the next one. So I started messing with VOX exports again, and I got it to export every time, even though I got a phony error message most of the time. I tested my files, and they did worked in LEGO Racers, a bit better than using SoX, but not perfectly. I proceeded to update this tutorial with the new info and method.

On April 29, 2013, rioforce began looking at creating working custom music for Racers. He actually had been developing a method for a few months, and had actually uploaded a video showing off his WIP method. But on the 29th, he really began finalizing that method. Once he had the proper settings, he recorded a video showing how to do it, and wrote up a new tutorial on LEGO Racers Audio Modding, releasing it all on April 30, 2013. The next day, May 1st, I updated the tutorial here, ushering in a new and very nosy wave of LEGO® Racers modding.

Back to Table of Contents


Note: the following tutorial was written in the voice of rioforce. Anytime “I” or a similar reference is used, he is referring to himself.

  • Have a song that you like to hear.
  • Know where you want that song to play in-game. (I want my song to play on the main menu).
  • Import your song into Audacity. I recommend that you use the newest version of Audacity.
  • Re-sample your track.
  • In the bottom right hand corner of the window, there is a drop-down menu labeled “Project Race (Hz)”. Select 22050 from the menu.
  • Select all the audio by pressing Ctrl+A on your keyboard, and go to Tracks>Resample and select 22050 from the resulting box.
  • If your music is Stereo, select all the audio again and go to Tracks>Stereo Track to Mono and let that work. This step is necessary because VOX cannot support stereo audio, only Mono audio.
  • Now, select all (Ctrl+A), go to Effects>Compressor. Change the settings according to the picture below.
  • I recommend repeating the previous step. Basically what the compressor does is makes all the audio volume level so there are not major changes in the volume. For some songs, you may want to repeat Compressor a third time! Just make sure that the waveforms look nearly the same level.
  • Your waveforms should look something like this:
  • Now you need to Amplify the track a bit. Effect>Amplify. I try to amplify it until it is clipping a little bit.
  • This is what your amplified audio should look like:
  • Now export your music! Go to File>Export and in the resulting window, in the Save as type drop-down menu, select Other Uncompressed Files and click the Options button to the right. Under the Header menu, select RAW (header-less), and select VOX ADPCM from the Encoding menu below. Click OK
  • Navigate to where you want to save your audio. If it is music, you can save it in the same folder as LEGORacers.exe.
  • Since I am replacing the main menu music, I will call my song “theme.tun“. Then, replace the original theme.tun in Program Files.
  • Error Message Ahead!

  • More likely than not, you will get an error message from Audacity that it could not
    export the audio, and will give you the following error message:

    Don’t worry. You’re audio was exported correctly. 😉
  • Now open LEGO Racers and listen to your music! 😀

Back to Table of Contents


Video of my Music modding (using original SoX method):

Video of my SFX modding (using original SoX method):

SFX modding video (using old SoX method):

Video of Voice modding, uploaded by Rocket9964 (assumed to use using original SoX method):

Video of Music modding, uploaded by rioforce (using his method):

Back to the Table of Contents


One thought on “LEGO Racers Custom Audio Tutorial

Triangular Reactions

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.