AudioLoader

v1.0.1·Updated 2021-09-26

Utility library to load custom sounds into Timberborn's SoundSystem

About this mod Author’s original text

A simple library that will shoehorn an audio file into Unity + Timberborn's AudioClip system. The way to play that clip varies, but Timberborn essentially has a list of AudioClips and it accesses them in various ways using a string as ID. This Library allows you to load your own sound files/data into that system, and add it to that list.

There is also some kind of Audio grouping system, and if your sound's clipName doesn't conform correctly, it crashes the game. I don't understand the group system super well, but I've been able to put different sounds in different groups by altering its ID string/clipName.

If the clipName string begins with 'UI.\', then it will end up in the UI group ¯\\(°\_o)/¯

Clips in the UI group can be played with the Timberborn.UISound.UISoundController::PlaySound2D() object method, probably by other means too. Have fun!

Example/Usage:

AudioLoader.I.Load(string filePath, string clipName, UnityEngine.AudioType.MPEG); //mp3 from a file

AudioLoader.Instance.Load(byte rawData, string clipName, AudioType.OGG); //ogg from the raw bytes (writes the file to temp, then uses the above. For techincal reasons.)

Install & use Install: follow the bundled instructions

  1. Unzip the archive from playbuff and read the bundled readme / instructions first.
  2. Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
  3. For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
  4. Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.

Install locations vary a lot between mods — the bundled readme is the most reliable guide.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack_Timberborn

File & checksum

Filename
AudioLoader-1.0.1.zip
File size
13.4 KiB