EffectPreset .csv format + fixes on SaXAudio#1391
Conversation
|
With my old version of SaXAudio (which I tried my best to fix using ChatGPT/Gemini and my own experience) Example :mono.dll caused an Access Violation (0xc0000005) With this new version of Odin and the new Debug: before my fixes, I can confirm that Odin’s solution offers much more stable RAM (seems capped to ~1,7 - 1,8 Go) |
julianxhokaxhiu
left a comment
There was a problem hiding this comment.
I personally reviewed the SaXAudio related patches and LGTM - well done and thanks again @DV666 :)
This PR contains some fixes to complement the last Odin's PRs (about SaXAudio).
The major issue is, when "spamming" a sound, it's not called again immediatly : the sound is still played until the end and silently. Seems the same sound is not recycle correctly.
Here is the summary of my PR :
➡️ EffectPreset .txt => .csv format
By default, the AudioEffects is a .txt file at the root of the mod folder => Imo, i prefer to move it into a .csv file, since it's the usual format used in Memoria.
=> New path:
"StreamingAssets/Data/Voices/AudioEffects.csv"The data on this file is the same as previous, i didn't change anything.
➡️ AudioEffectManager.Init() wrongly Init
I tested the
Unity Debug modemade by Odin's PR and... my Visual Studio finds a critical issue on this part:Memoria/Assembly-CSharp/Global/Sound/SaXAudio/AudioEffectManager.cs
Lines 296 to 309 in a7e58e0
To be more precise, the
FileSystemWatcher(line 298) was wrongly declared (because of this*).If i understand correctly, since this thing was wrongly init, the
Mono.dllwas spammed a lot by this... and maybe that's one of the reason of these random crashes from SaXAudio ? (the famous crash with Mono.dll i get a lot of time from my previous investigations since the last year)Anyway, with this little fix, the Debug don't say anything when launching the game now :)
➡️ SaXAudio.dll Sound Recycling Fix
As i said at the beggining, the major thing about this PR is to fix an issue where a sound wasn't recycled/replayed correctly immediately after being stopped with a fade-out.
An IA help me on this one to fix this issue (quite easily) : basically, a sound that used a fade prevented the engine from being re-invoked.
This small fix in
SaXAudio.dllresolves the issue.➡️ NCalc Expression Caching
This is an approach I’ve applied to quite a few features that use NCalc in Memoria (from my other PR #1255): the idea is simply to "pre-calculate" basic NCalc functions, particularly these ones.
Memoria/Assembly-CSharp/Global/Sound/SaXAudio/AudioEffectManager.cs
Lines 162 to 165 in a7e58e0
This saves a considerable amount of processing time for the game: for SaXAudio, I don’t think it’s particularly useful… but at least it’s there :)
➡️ Little QoL for Debug Menu
The research bar is available for every type of sounds... i think it's more comfortable in that's way