-
Notifications
You must be signed in to change notification settings - Fork 0
How to optimise Audio
Generally speaking 96kbps OGG sounds as good as 128kbps MP3. Here's a study demonstrating this.
Depending on the audio you may want to use Mono or Stereo (1/2 Audio Channels) to save space while maintaining quality. The majority of sound effects are played in the 3D space around the camera so Stereo doesn't matter and just wastes space, you can use the Debug Menu in ModAudio to differentiate 2D/3D audio and make adjustments as necessary. Mono SFXs are ideal for Homebrewery cause it doesn't have any audio events that play from the speakers directly like music does.
Note we're here to optimise file size; Memory (RAM) usage from non-streamed audio is dependent only on the Sample Rate & Channnel Count, since the whole file is loaded into memory uncompressed in that case.
Before we start you'll want to get FFmpeg first: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.7z
Extract the zip and put the "bin" folder somewhere permanent, since we'll be using the path to it for the Environment Variables.
You'll need these batch scripts. You can either paste them into a text editor and save as .bat or download Batch Scripts.zip.
- Mono
@echo off
echo on
for %%a in (%*) do ffmpeg -i %%a -vn -map_metadata -1 -acodec libvorbis -b:a 96k -ac 1 "%%~na.ogg"
pause- Stereo
@echo off
echo on
for %%a in (%*) do ffmpeg -i %%a -vn -map_metadata -1 -acodec libvorbis -b:a 96k -ac 2 "%%~na.ogg"
pauseOpen "System Properties" by using Windows Run (Win + R): sysdm.cpl
Click "Advanced" and then "Environment Variables" at the bottom right. There should be a listing called "Path" in both boxes.
When a path to a program is added to this variable it acts as a CMD shortcut to it, allowing you to use the executable from anywhere (which is important since CMD always has an active directory of somewhere, and anything you try to do is relative to that). With the Path variable selected click "Edit...", in the popup window use either "New" or "Browse..." to paste the path to the folder you put FFmpeg into. Putting it in User Variables should is enough.

Screenshots were edited for privacy reasons.
Once the setup is complete you should then be able to drag & drop audio files onto the .bat files wherever you've got them, and they'll do the job and output the converted files next to the originals. Where you put the batch scripts doesn't matter like FFmpeg, but it's advised to put all of these together in a folder to keep yourself organised.
What the FFmpeg command is actually doing:
- Stripping the metadata off the file. We don't need any of that information since we're just using the audio data.
- Mono Batch: Downmixing all audio channels into a single one, so Left & Right stereo channels will be mixed together.
- Stereo Batch: Downmixing channels above Left & Right into conventional 2 channel stereo, or maintaining the existing stereo channels. Mono files will be converted into stereo by duplicating the single channel to the Left & Right channels, this is probably not very good when done this way and you likely shouldn't need to be doing that anyway.
- Encoding the file as Vorbis OGG at 96Kbps VBR. You could also use Opus GG ("libopus") but don't think that would make much difference on the file size ultimately.
Axiom is an FFmpeg GUI for Windows. It may take a little more effort to set up and use than the batch scripts but provides much fancier tools for advanced users. Also suggest Audacity for audio editing and MP3Tag as a metadata-stripping tool.
Download Axiom from Github optionally with FFmpeg pre-installed, and extract it then run axiom.exe (or make a shortcut). The User Guide explains the application in great detail!

It may be overwhelming at first but we're focusing only on the top left and right side for now.
In the "Format" tab change the "Container" to OGG. Move to the "Audio" tab and change the following:
-
Audio Codec: Vorbis -
Channel: Mono OR Stereo, leave as "Source" otherwise. -
Quality: 96 -
Sample Rate: 44.1K
Click on "Input" in the top left and select the file you want to convert or paste in the folder path, Multiple conversions can be done by enabling "Batch" at the bottom and selecting a folder. Ideally repeat for "Output" then click Convert! If everything went well, you should have a Vorbis OGG file with 96kbps and 44.1K Sample Rate with 1-2 Audio Channels.
Some bonus tips now that the guide is over.
- Create a preset (next to Batch) to skip repetition.
- Configure the settings and read the buttons/tabs.
- Make "Input"/"Output" folders wherever your setup is to keep organised.
And lastly... always backup your files before doing any modifications to them!