You are viewing a potentially older version of this package. View all versions.
no00ob-LCSoundTool-1.4.0 icon

LCSoundTool

Let's you easily load audio files, replace in game audio, send audio over the network and log any audio playback into console.

Date uploaded 5 months ago
Version 1.4.0
Download link no00ob-LCSoundTool-1.4.0.zip
Downloads 1726203
Dependency string no00ob-LCSoundTool-1.4.0

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

LC Sound Tool

This mod is by default FULLY CLIENT SIDE, but if you enable the networking feature in the config it requires everyone to have it installed and for everyone to have the networking feature on.

Simplistic Lethal Company sound tool/API and debugger. Patches all native Unity AudioSource components allowing you to dynamically replace any sound in the game at the final stages of playback with one or multiple random options with specified chances by simply supplying new audio clip(s) and the original clip's name to this mod. Let's you easily load your own custom .wav, .ogg or .mp3 sound files for use with your own mods. Experimental networking for sending and syncing audio clips across all of the connected players and syncing the Unity randomization seed for consistant random clips. Lastly, optionally allows logging all AudioSources playback, including PlayOneShot, PlayClipAtPoint etc. and the names of each audio clip playing into the BepInEx console and log when you press the F5 key. More in depth logging can be toggled with LeftAlt + F5 and more informational logs with LeftControl + F5.

ATTENTION

This mod won't work without a mod of your own that does the replacing. This mod is just purely a tool/API for replacing, loading and networking sound files. To be able to replace sound without creating a mod of your own you can try the following seperate mod utilizing this tool: https://thunderstore.io/c/lethal-company/p/Clementinise/CustomSounds/

Features

  • Press F5 to log all audio playback to BepInEx console.
  • Load your own custom .wav, .ogg or .mp3 audio files for use within your mod.
  • Replace any audio clip with another one or multiple random ones with specified chances for playback.
  • (Optional) Send audio clips over the network and sync the hosts clips with all clients.
  • (Optional) Sync the Unity randomization seed with all players.

Installation

Install like any other BepInEx mod, either manually or with mod manager of your choice. I recommend r2modman.

When installing manually, install the mod to the following directory: \GAME_LOCATION\Lethal Company\BepInEx\plugins

Usage/Examples

Check the mod wiki for detailed instructions on how to use this mod as mod developer or user.

And for more in-depth developer example see the following github repo: https://github.com/no00ob/LCSoundToolTest

FAQ

Why are none of the logs showing up?

Make sure you have at least the following BepInEx.cfg settings:

  • [Chainloader] HideManagerGameObject = true
  • [Logging.Console] Enabled = true
  • [Logging.Console] LogLevels = Fatal, Error, Info, Debug, Warning
  • Possibly [Logging.Disk] WriteUnityLog = false

If nothing else works you can try my BepInEx.cfg from here: https://pastebin.com/LdsPhH5U

If they're still not showing up just shoot me a msg in Discord (@no00ob) and we can try to figure it out.

Why does this one sound not show up in log and I cannot replace it?

This should not be happening. If you are sure you found a sound that does not work, please take note of the name and where it plays and send it over to me in Discord as either a DM or on the Lethal Company Modding Server in the LC Sound Tool forum as a post.

Why is the networking not working?

Make sure you turn the feature on in the mod config. When networking is turned on everyone needs LCSoundTool installed to join a lobby or else you will get an error.

Can you use this tool to record sounds or interact with the voice chat?

No, not at the moment. I might look into this later. If you want enemies to use player voices check out SkinWalkers mod.

What is the performance impact of this tool compared to just manual replacement?

I have not done any major testing. In theory this should add very tiny slight delay and overhead to any audio playback, but no major delays or issues have been encountered. The programming in this game is so messy sometimes that finding certain audio clips was painful enough where I just decided that a tool like this might come in handy.

Can you add this or that?

Depends totally on what you're asking. If you want a new feature that has something to do with this mods original scope and improves it in a meaningful way, feel free to shoot me a message on Discord as a DM or on the Lethal Company Modding Server in the LC Sound Tool forum as a post or in Github as an issue and I'll take a look. Otherwise no.

Does this mod work with other Unity games?

Any version prior to 1.2.0 should and versions past that will not work. I tried the pre 1.2.0 version with my Unity 2022.3.x game and it did work for it too. The mods replacing the audio do not however, as different games use different sounds obviously.

Can I contribute somehow?

Yes. If you find any bugs or errors let me know and feel free to send pull requests my way if you feel like you can provide better programming, bug fixes or more features.

Config

The config can be found from: \GAME_LOCATION\Lethal Company\BepInEx\config\LCSoundTool.cfg

or if you're using mod managers you can find the config from here: Example

## Settings file was created by plugin LC Sound Tool v1.4.0
## Plugin GUID: LCSoundTool

[Experimental]

## Whether or not to use the networking built into this plugin. If set to true everyone in the lobby needs LCSoundTool installed and networking enabled to join.
# Setting type: Boolean
# Default value: false
EnableNetworking = true

## Whether or not to sync the default Unity randomization seed with all clients. For this feature, networking has to be set to true. Will send the UnityEngine.Random.seed from the host to all clients automatically upon loading a networked scene.
# Setting type: Boolean
# Default value: false
SyncUnityRandomSeed = true

## How long to wait between checks for new playOnAwake AudioSources. Runs the same patching that is done when each scene is loaded with this delay between each run. DO NOT set too low or high. Anything below 10 or above 600 can cause issues. This time is in seconds. Set to 0 to disable rerunning the patch, but be warned that this might break runtime initialized playOnAwake AudioSources.
# Setting type: Single
# Default value: 90
NewPlayOnAwakePatchRepeatDelay = 90

Known Issues

  • Currently should be none :)

CHANGELOG

  • 1.5.1

    • Fixed a bug where the Boombox and other vanilla audio was not being randomized properly after the last update.
    • Fixed a bug where the Extension Ladder and few other vanilla audio sources that played multiple different sounds were not working properly after the last update.
    • Fixed a bug where all sounds using a specific audio source could get wrongly checked for the source name filter if one sound playing through it had it defined.
    • Fixed a bug where syncing all networked sounds to clients could cause an overflow error if the string array was too long.
    • Fixed a bug where the legacy path warning was triggered wrongly for CustomSounds based mods. (sorry for taking this long Clementinise lol)
    • Fixed a bug where certain sounds could get stuck in the fileType dictionary as it has now been removed.
    • Improved networked sound handling. Now channels and frequency gets synced and handled properly.
    • Further tweaks to logging. New logging messages and fixes to existing ones.
    • Rewrote the SoundTool class to remove bloat and simplify future updates. You need to now define all parameters and nothing gets parsed automatically from the sound name anymore!
    • Other small internal tweaks and QoL changes for myself for future updates :)
  • 1.5.0

    • Added support for AudioSource names as filters to where sounds can play. No more same sound from different sources!
    • Fixed a bug where AudioSources using the standard Play() would not randomize properly.
    • Added a config option to turn informational debugging on by default on launch.
    • Some minor tweaks to logging again. Mostly the same this time too. Cleaned up some useless messages, fixed typos, etc.
    • Added few new mod API methods and updated existing ones. You can now use some of the methods with different parameters than before.
  • 1.4.0

    • Added support for Ogg Vorbis and Mpeg MP3 files. Now any of the 3 file types should work. Wav, ogg or mp3.
    • Reworked playOnAwake patching. Hopefully now ALL playOnAwake AudioSources and sounds should work without any problems.
    • Added a config option to let the mod patch any playOnAwake AudioSources that get created later during a game, as before it only ran when a new Unity scene was loaded. The option is for the delay between each runtime patch.
    • Added config option to sync host's Unity built in randomization seed with all clients. Random sounds should be the same for everyone with this on.
    • Some minor tweaks to logging. Mostly cleaned up some useless messages, fixed typos and added a new keybind for informational logs, F5 + LeftControl.
    • Added few new mod API methods and updated existing ones. You can now add sounds with multiple random variants from code without having the chance specified in the file name and small tweaks like that.
  • 1.3.2

    • Small bug fixes.
    • Made networking optional. It was never meant to be forced on. It can now be toggled from the config file.
  • 1.3.1

    • Changed the random clip seperator from "_" to "-".
  • 1.3.0

    • Internal restructure of multiple parts of the mod. Shouldn't change previous behaviour.
    • Added support for random replacement clips. One vanilla sound can now have new multiple random clips with set chances that play randomly when the vanilla sound would.
    • Fixed multiple small bugs. AudioSources with playOnAwake set to true should now play more than once when the scene is not reloaded between playback.
    • Experimental networking for Unity AudioClips. Send AudioClips over the network to all connected players, also optionally sync all of the networked clips of the host to all clients.
    • Minor tweaks for game v45
  • 1.2.2

    • Added support for mod managers. This changes the folder structure and loading of custom sounds a bit and all mods will need to be updated to work with mod managers. Old mods will continue to work with the newest release when manually installed. Mods only need to update to support mod managers, otherwise no sounds will load when using a mod manager.
  • 1.2.1

    • Minor edits to mod page.
  • 1.2.0

    • Added ability to load sound files from plugins folder, more in depth logging option and support for most AudioSources with playOnAwake flag set to true.
  • 1.1.1

    • Minor edits to mod page.
  • 1.1.0

    • Added a way to replace any in game audio clip by a custom one. Mod released on thunderstore.
  • 1.0.0

    • Mod released on github.