loaforcsSoundAPI
A general use library to replace sounds in Unity games.
CHANGELOG
2.0.1
- Replacements and sounds with a condition that are labelled as
constantare now skipped when loading, as opposed to just entire replacer files - Conditional objects marked with
constantalso now skip validation and mapping (meaning custom conditions/mappings from mods can be properly used like a soft-dependency) - Fixed an issue where it was impossible for some sounds to be randomly chosen
- Added validation error for missing mapping
- When logging validation errors, the log source now has
soundpack.infront of the sound pack name - Changed
resetsattoresets_atfor thecountercondition - Added logs for when SoundAPI handles DebugLogSources
- Added smarter internal logic to handle SoundAPI updating some AudioSources. Should maybe be more performant
- Fixed an issue where the
MatchStringsDebugLogSource did not log anything unlessGenerateReportswas also enabled.
2.0.2
- woops
2.0.3
- fixed an issue where if SoundAPI had nothing to load, it would spin infinitely.
2.0.4
- bleh
2.0.5
- upload to R.E.P.O.
2.0.6
- fixed an issue where SoundAPI would cause many issues if a loaded sound-pack tried to reference files that didn't exist.
- fixed an issue where SoundAPI would stop audio sources from playing if they were marked as
playOnAwakeand loaded with a scene.- note: this has a temporary config to disable it, as i'm not entirely sure if this will fully work
- added an extra check to prevent duplicate sound-packs from loading.
- added a warning log if no sound-packs loaded.
2.0.7
- uploaded to PEAK
- removed previously temporary config
- add metadata spoofing (fixes config names in Gale acting strange)
- added a new experiment
- audio clip spoofing: enabling this experiment makes soundapi lie in some cases to other mods and the vanilla game about the true audioclip. this can help improve compatibilty
2.0.8
- hopefully fixed some issues with audio clip spoofing
- fixed an edge case where when a prefab was instantiated with a disabled
playOnAwakeaudio source soundapi would try to play it (harmless, only a warning log) - fixed config generation so that soundpacks which do not define config do not create a file.
2.0.9
AudioClipSpoofingis no longer an experiment and is defaulted totrue(it can still be disabled under theAdvancedsection in the config in case there are some remaining edge cases)UEFOneShotWorkAroundhas been added as a new experiment:- Some sounds are played on AudioSources with
.PlayOneShot(), for these sounds it's impossible to replace them as they are being played - As a work-around, this experiment hijacks
.PlayOneShot(), instead creating an AudioSource with duplicated settings, and calling.Play()instead
- Some sounds are played on AudioSources with
- Added
SoundAPI.CloneAudioSource(source, target, flags)to facilitateUEFOneShotWorkaround - Native Backend:
- Native Backend is a rewrite to the patching method used to detect when an AudioSource has started playing.
- This fixes all
playOnAwakeedge cases- Notably the ship thrusters in Lethal Company which were enabled by an animation were previously unreplaceable (at least im pretty sure; im writing this months later)
- As a result native backend should also be significantly more performant, especially when many prefabs are instantiated in a short time frame
- For example dungeon generation in Lethal Company would be faster (although async dungeon generation in v80 means it may not be noticable as much)
- Native Backend is only supported on some unity versions:
2022.3.9f1(Lethal Company pre-v73)2022.3.62f2(Lethal Company post-v73)- This version has a further performance improvement regarding cleaning up AudioSources when a scene is loaded
2022.3.60f1(internal test project)- If SoundAPI is run in an unsupported version it will fallback to the previously used HarmonyX backend, although this won't be supported as much.
- A config option
PreferredBackendis available to force use of the old HarmonyX backend, though the Native Backend should always be used if available
- Reports generated by SoundAPI now include the game name/version/company, the unity version and if native backend is supported/enabled.
2.0.10
- Fixes an issue where the HarmonyX backend did not work in REPO.
2.0.11
- Fixes an issue where SoundAPI could only replace the same audio clip on the same audio source once.