Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

How to make your own music mod - A Tutorial for Sonic 3 A.I.R..

This explains how to make your own music mod (Formerly "How to edit audio_replacements.json")

This tutorial shows you how you can make a custom soundtrack for Sonic 3 A.I.R

1. How to get to your mods folder

Your mod's folder is located at
Windows - %appdata%\Sonic3AIR\mods\

Linux(If you can get the game working with wine) - ~/.wine/drive_c/users/(username)/Application Data/Sonic3AIR/mods/

You can get there in 2 ways
  1. Go to the folder
  2. Right click the game while its loading, playing or anything but erroring and click "Open Save Data Folder"

All the screenshots you will see are from Linux although it should be the same on Linux and Windows (Not sure if Sonic3AIR works on Mac via Wine)

2. Prerequsites

  • Some music
  • And a text editor (I will be using Sublime Text but Notepad++, VSCode or normal notepad will also work)
  • The ability to see filetypes(On Windows, Open explorer, click View then toggle "Show filetypes")

3. Terms used

OGG - The OGG File format. Commonly used in Video Games because it's free, open sourced and lightweight(Also used in Sonic 3 AIR for mods and such)
MP3 - The MPEG-3 file format. Commonly used in albums or CD's
JSON - A popular data format used commonly for Config's and storing data for things like Games and applications 

4. Step 1 - Getting the files and folders we need

After heading to your mods folder you're going to want to make a new folder named what you want to name your mod, Then inside that folder you're going to want a folder named "audio" and a file named "mod.json", Your mods folder should be laid out like the below

Open up the mod.json file with your text editor and input this
		"Name": "My Music Mod",
		"Author": "Me!",
		"Description": "A pack that add's music I like!",
		"URL": "",
		"ModVersion": "1.0",
		"GameVersion": "Game version"
Change everything to what you want. You can get the game version from the top right of the title screen.
Now you will need to grab the "audio_replacements.json" file from the folder for sonic3AIR you downloaded, go to the folder that you extracted Sonic 3 AIR to, then go to docs > modding > audio then you should see a file named "audio_replacements.json" or "audio_replacements".(depending on if you have file extensions on) 
Copy that to the audio folder we created earlier. 
You'll also need to copy some OGG files over with the audio_replacements file. 
They have to be OGG files. I would recommend using Audacity's "export" feature to export as an OGG file if its a MP3, WAV or most other types of music files. MIDI is not supported though
If you need to do a bunch of files then I'd recommend Fre:ac, which is on Windows, Mac and Linux

5. Step 2 - Editing the file

So we have finally stopped messing around with file locations and its time to get serious.
I am guessing you want to instantly edit the file but if you are not used to json files then you probably won't understand them
Here is some example code:
//AIZ 1
    "01": { "File": "my_music.ogg", "Type": "Music" }
Do you understand how this is laid out? No? Don't feel bad,
This is what you would put in to edit the music for angel island zone.
The 01 in quotes stands for the song you want to replace in its megadrive value
{ "File": "my_music.ogg", "Type": "Music" }
Tells the game that you want to use "my_music.ogg" and tells the game that it's type is "Music" so to edit hydrocity zone act one I would do
    "03": { "File": "music_file.ogg", "Type": "Music" }
Don't forget to replace the "music_file.ogg" with your song name, so for example I would use "sonic-mania-hydrocity-zone.ogg" if I had a file named "sonic-mania-hydrocity-zone.ogg" in the audio folder.

Getting lost yet?

From 01 to 17 are all of the zone's but it is not done as you may think instead of 8-9-10-11 it is 08-09-0A-0B-0C-0D-0E-0F-10 Instead so for flying battery zone you would use
"0A": { "File": "my_music.ogg", "Type": "Music" }
"10": { "File": "my_music.ogg", "Type": "Music" }
If you need any more help just look at the example audio-replacements.json file and that should help. For my audio mod that I made(It just replaces the invincibility and super theme) I used

Just for a recap, the word's/numbers in the first quotes are the ID of the song,
"File": "super.ogg"
is the song file that we want to use so for example
"25_sonic3": { "File": "bgm_title.ogg", "Type": "Jingle" }
will change the sonic 3 title song the the file named "bgm_title.ogg" in the audio folder.
Whenever you have multiple songs always add a comma next to the last song like this
  "2C": { "File": "invinc.ogg", "Type": "Music" },
"supertheme_sonic2": { "File": "super.ogg", "Type": "Music" }
It is important you add that comma as the game will error if you miss a comma, and lastly always add the "{" at the beginning and add the "}" at the end. 
Feel free to tell me if I did or got something wrong, also if you need a good JSON parser/JSON editor then use Duck Duck Go's JSON Beautifierjsoneditoronline, or jsonformatter

6. Extra Step - Looping (Thanks to MaybeGreg for this part)

Looping your music can be difficult if you aren't sure what you're meant to do, but let's go through it.
Bring your music track back into Audacity. What you want to do is find the point where the music jumps back to a previous point, or if it doesn't naturally a point where it can. Example. This point in the song is where the goes back. Delete everything from this point onwards. No point having extra.
Now that we've got the end of the loop, we need to go to the start. This is where everything extra you just deleted is played for the first time. In our example case, here. Select the exact point. At the bottom of Audacity, you see the current time. Click the selector, and choose samples. Keep note of this number.
Now, export the song as stated above.
Go into your json again, and do the exact same steps. However, this time, it should look more like this:
"0A": { "File": "my_music.ogg", "Type": "Music", "LoopStart": "X" }
Remember that number you wrote down? 
Replace X with that. Save it, restart your game, and you should be able to hear the loop work just fine. Here's my SMB1 example in practice:
"0A": { "File": "SMB1_Overworld.ogg", "Type": "Music", "LoopStart": "114688" }

7. Step 3 - Finalising

So now you have completed your mod and you want to play with it ingame, well that's easy just boot up the game and hope you did not mess up any of the code. 
If you need help feel free to ask in the comments and me or someone else will probably help you, Have fun modding the game!

1-10 of 30
Go to page:
  • I'm just curious I'm starting to learn how to add my own sounds and while editing the audio_replacements file it mentions this  

    "Spindash release sound (note: it uses the spindash charging sound's channel "AB", in order to stop it)"

    "In addition, all the sound IDs from "33" to "BB" are valid keys you can replace with your own ogg files."

    "The only difficult cases are the following sound effects, which won't really work by playing an audio
    file, but need to be emulated instead: - The spindash charging sound "AB" (because of the reverb effect)The continuous sound effects, which is full range from "BC" to "DB""

    If it's possible could you explain these? Because I really want to change the spindash sound.

    URL to post:
  • Flatened_Blueberry avatar
    Flatened_Blueberry Joined 9mo ago
    314 points Ranked 65,650th
    5 medals 1 legendary 1 rare
    • Returned 5000 times Medal icon
    • Returned 1000 times Medal icon
    • One month a member Medal icon
    • Returned 100 times Medal icon
    • 6 months a member Medal icon
    I Think i screwed up something, once i turn on the mod, all the music other than the audio in the mod stops, the sound effects work except for the ring sfx, then once i restart the game with the mod on, it displays an error message that says "Failed to load audio file" "*mod folder path*" "Caused during script execution in function 'Standalone.playAudio' at line 354 of file 'audio.lemon' in module 'GameScript'.", is there a way to fix all of this?
    URL to post:
  • JessieTails1992 avatar
    JessieTails1992 username pic Joined 1y ago
    2,027 points Ranked 22,931st
    14 medals 1 legendary 1 rare
    • Returned 5000 times Medal icon
    • Returned 1000 times Medal icon
    • Returned 100 times Medal icon
    • One month a member Medal icon
    • Became a Studio Leader Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    Looping on android ?
    Back modding S3AIR For GB avatar
    Back modding S3AIR For GB
    URL to post:
  • Quix64 avatar
    Quix64 Joined 12mo ago
    650 points Ranked 50,957th
    5 medals 1 rare
    • Returned 1000 times Medal icon
    • Returned 100 times Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    How can I see the samples on Android? I have the editing and that but for the loop I can't see how to make it since it requires samples to add to the loop
    URL to post:
  • Sarks avatar
    Sarks Joined 2y ago
    88 points Ranked 70,267th
    Sorry for the trouble but I'm new to this, I want to see, how could I make a fast version of a song like for example "AIZ act 1", I just make a file that goes faster?
    Come on wake up
    URL to post:
  • Anyway I can do this on mobile?
    URL to post:
  • Chubbulus avatar
    Chubbulus Joined 10mo ago
    286 points Ranked 68,151st
    10mo 10mo
    Hi. Just wondering how I would go about turning this into a mod that others can download? Would each person need to manually extract the Audio_replacement JSON file from my uploaded mod and replace their JSON file, or does the game automatically do this if it detects an audio_replacement JSON file within the mods folder?

    Sorry if this is a dumb question, first time modding this particular game!

    Female scientist of computers!
    URL to post:
  • WarpedMarioBros avatar
    WarpedMarioBros Joined 10mo ago
    117 points Ranked 99,034th
    How to make alt music for Knuckles?
    URL to post:
  • waycools3air123 avatar
    waycools3air123 username pic Joined 2y ago
    275 points Ranked 69,241st
    12 medals 3 rare
    • Thanked 50 submitters Medal icon
    • Returned 1000 times Medal icon
    • Received thanks 50 times Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    • Thanked 5 submitters Medal icon
    How you can see how many samples a part of an song has in Adobe Audition? i've changed to from Audacity to Adobe Audition 1 day ago and i've don't know how to see a part of the song on samples. it's the counter at the bottom left that it's like this: X:XX.XXX actually the sample rate thing?
    Bananite Sonic 3 A.I.R Fan avatar
    Bananite Sonic 3 A.I.R Fan
    URL to post:
  • DanTheLoler17 avatar
    DanTheLoler17 Joined 2y ago
    Playing Sonic 2
    412 points Ranked 59,161st
    16 medals 2 rare
    • Returned 1000 times Medal icon
    • Thanked 50 submitters Medal icon
    • One month a member Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    • Returned 100 times Medal icon
    • 6 months a member Medal icon
    You can use mp3's? I've been using ogg's the past year.
    TURN OFF THE FILTERS!!!!!!1!! avatar
    URL to post: