You are viewing a potentially older version of this package. View all versions.
Marioalexsan-ModAudio-1.0.4 icon

ModAudio

Replace game audio with your own mixtape.

Date uploaded a day ago
Version 1.0.4
Download link Marioalexsan-ModAudio-1.0.4.zip
Downloads 362
Dependency string Marioalexsan-ModAudio-1.0.4

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

ModAudio

Replace game audio with your own mixtape.

This mod can either be used stadalone, or it can be used to make audio pack mods.

Currently, .ogg, .mp3 and .wav formats are supported.

Standalone Usage

To replace game audio, put your custom audio files under BepInEx/plugins/Marioalexsan.ModAudio/audio/. If you're using a mod loader such as r2modman, you will have to navigate to that mod loader's BepInEx folder and put your files there.

There are two ways to do the replacement:

Audio files named after audio clips

Name your custom audio the same as the audio clip you want to replace. For example:

  • _mu_wonton5.ogg would replace the _mu_wonton5 clip that is the Crescent Grove combat music
  • _mu_flyby.wav would replace the _mu_flyby clip (main menu music)
  • weaponHit_Fire(average).mp3 would replace weaponHit_Fire(average), i.e. one of the hit sounds

You can use any of the supported audio formats, but there should be only one format used per audio clip (i.e. if you have both foo.ogg and foo.wav, only one will be selected).

Audio files routed to audio clips

Put your custom audio in the audio folder, the name doesn't matter in this case. Afterwards, make an association between the audio file's name (without extensions) and the clip it's supposed to replace in the __routes.txt file from the audio folder (create it if it doesn't exist).

An example __routes.txt file that would map multiple hit sounds to a pow.ogg audio file you've placed in the audio folder:

weaponHit_Air(average) = pow
weaponHit_Air(heavy) = pow
weaponHit_Air(light) = pow

This can be useful to avoid duplication and to keep meaningful names for your custom audio.

Audio Pack Mods

You can specify custom audio via mods that depend on ModAudio.

Mods without plugins

You can make mods without plugins (i.e. a DLL). This requires you to add your assets under the audio folder (i.e. BepInEx/plugins/Your-Mod-Id/audio/). ModAudio will try to detect audio in that folder and load it automatically.

You can also put your assets directly in the mod's root folder if you want to (i.e. BepInEx/plugins/Your-Mod-Id/).

However, when loading from root, you have to either have a __routes.txt file present (even if it's empty), or at least one audio clip named after a vanilla clip.

Mods with plugins

When making mods that have a plugin, you specify the audio to load by using the LoadModAudio method.

Here's an example plugin that loads audio from a folder at runtime:

[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInDependency("Marioalexsan.ModAudio")]
public class MyCustomAudio : BaseUnityPlugin
{
    private void Awake()
    {
        Marioalexsan.ModAudio.ModAudio.Instance.LoadModAudio(this);
    }
}

This will load audio in a similar way to how it's done for Standalone Usage, using audio files and __routes.txt from the audio folder next to your mod's assembly.

This allows you to create audio pack mods that you can distribute easily.

If you need to load audio from a different folder, you can specify it using a second parameter:

[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInDependency("Marioalexsan.ModAudio")]
public class MyCustomAudio : BaseUnityPlugin
{
    private void Awake()
    {
        Marioalexsan.ModAudio.ModAudio.Instance.LoadModAudio(this, "C:\\mycoolmusicpath");
    }
}

This allows you to be more flexible with where you put your assets if you need that.

Mod Compatibility

This mod version targets ATLYSS v1.6.0b. Compatibility with other game versions is not guaranteed, especially for updates with major changes.

CHANGELOG

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[1.0.4] - 2024-Dec-28

Changed

  • Improved audio loading from root folder, it will now also load audio from root if there's at least one clip with a known vanilla name

[1.0.3] - 2024-Dec-27

Changed

  • The mod will now load assets from mods that don't have a DLL plugin. It will load any audio from the "audio" folder (i.e. BepInEx/plugins/Your-Mod/audio) if it exists. It will also load audio from the root folder (BepInEx/plugins/Your-Mod/) if there is a __routes.txt file present

Fixed

  • Fixed an issue related to using the mod without any audio under ModAudio/audio

[1.0.2] - 2024-Dec-23

Changed

  • Removed NAudio dependency in favor of UnityWebRequestMultimedia

Fixed

  • Audio played via AudioSource.PlayOneShot should now be replaced correctly

[1.0.1] - 2024-Dec-23

Added

  • Option to enable verbose logging of audio sources that are being replaced, and audio sources that are loaded in

Changed

  • Improve reliability of audio replacement when scenes are loaded

[1.0.0] - 2024-Dec-22

Changed

Initial mod release