|
Post by OhiraKyou on May 16, 2022 6:10:23 GMT
I've long been using dynamic sound group creators and ambient sounds to play global sound loops, such as rain, within individual scenes. I remember trying another method of playing scene-global sound loops with Master Audio a long time ago, but the volume balance was quite off. In any case, after updating to Master Audio 2020.3.8 (possibly from version 4.2.0, according to my last committed ReleaseNotes.txt), I noticed that rain sounds would cut off at the default distance of 100 from the associated ambient sound object. I'd like to set these ambient sounds to be scene-global again. For reference, the dynamic sound group creators are configured with the spatial blend rule of "Force To 2D". Noticing something in the 2022 version's change log about a bug related to distance calculation, I purchased the upgrade, updated, and observed the same thing. So, am I missing some DSGC or ambient sound config to enable dynamically-created ambient sounds to play scene-wide? If not, I'd like to see one implemented. Even if there are better methods for playing global ambience now, it would, if nothing else, enable easy conversion of localized ambient sounds to scene-global sounds. Edit: A "do nothing" option for the ambient sound's trigger exit behavior dropdown list could work. And, manually setting the DSGC's audio source distance value to a high number (like 1000+) is a usable solution for now.
Versions with old Master Audio
Master Audio version 4.2.0 Unity 2020.3.15f2 Versions with newer Master Audio
Master Audio 2020.3.8 Master Audio 2022 version 1.01 Unity 2020.3.15f2 Unity 2021.3.2f1
|
|
|
Post by DarkTonic Dev on May 16, 2022 14:33:46 GMT
The "do nothing" option doesn't make sense performance-wise. If it's out of range and won't be heard at all, why take up the CPU? I suggest using Max Distances that are big enough for what you want.
By the way, the distance calculation was only used to determine when to shut off the Audio Source. We don't calculate the volume based on distance, that's all Unity.
-Brian
|
|
|
Post by OhiraKyou on May 16, 2022 19:19:48 GMT
If it's out of range and won't be heard at all, why take up the CPU? Scene-global ambience should never be out of range and always be heard. I suggest using Max Distances that are big enough for what you want. "Infinite" would be ideal in this case. By the way, the distance calculation was only used to determine when to shut off the Audio Source. We don't calculate the volume based on distance, that's all Unity. Spatialization is set to "Force To 2D", which disables attenuation. Therefore, there is, intentionally, no volume attenuation based on distance and, without Master Audio, the sound would be infinitely scene-global. Indeed, I can't imagine a situation in which I would want an unattenuated 2D sound to suddenly cut off based on distance. But, a setting would allow users to make that decision on their own.
|
|
|
Post by DarkTonic Dev on May 16, 2022 19:47:52 GMT
Let me reply to your last post point by point.
Question 1&2 1) If it never goes out of range, then the point is moot. Set your Max Distance to 1,000,000 or whatever the size of your map is.
3) Ah, no idea this was a 2D sound scenario. Anyway, set your Max Distances to a huge number and see if it works how you want. The main use case for Ambient Sound is of course 3D sound as you may have guessed.
Also, you don't have to use the Ambient Sound script if you want things to always play. You could just use Event Sounds on an OnEnable event and let it play and loop.
Thanks, -Brian
|
|