|
Post by DarkTonic Dev on Jul 10, 2019 18:26:44 GMT
So the ActiveVoiceCount is > 0 and nothing is audible? Are they definitely in audible range (if they're 3d sounds)? Did you try setting them as 2d?
If you have a lot of Ambient Sounds, you will have to set up your own mechanism for making sure only the ones in audible range are playing, or it will be potentially devastating on performance. Which of course it the primary reason we created the script.
|
|
|
Post by bigbrainz on Jul 10, 2019 22:05:06 GMT
I'm still really curious so I've kept messing with it a bit. I figured out how to send some debug info to the browser console:
Voices = 1 and ActiveAndEnabled = true. So it thinks it's still playing.
I can't figure out how to find out what it thinks the volume is or if it's in range. But I tried forcing it to 2D and setting minimum distance ridiculously high, so I think that it thinks its still playing it, but you can hear it just completely cut out as soon as it finishes the loop its on. Hmmm . . .
|
|
|
Post by DarkTonic Dev on Jul 11, 2019 19:36:21 GMT
What is ActiveAndEnabled?
Is it paused? You can check various things on the Audio Source itself like this:
var variations = MasterAudio.GetAllPlayingVariationsOfTransform(this.transform); if (variations.Count > 0) { var firstVar = variations[0]; // loop over them if there's more than one. Debug.Log(firstVar.VarAudio.isPlaying + " : " + firstVar.VarAudio.loop + " : " + firstVar.VarAudio.volume + " : " + firstVar.IsPaused); }
For the in range part, well you can detect if it goes out of range if you add debug code under the OnTriggerExit method in TransformFollower.cs. That gets called when it goes out of range and stops the audio.
|
|
|
Post by bigbrainz on Jun 4, 2020 23:47:33 GMT
Just a quick update a year later that it's still an issue with the latest version of Unity 2018.4.23f1 and Master Audio 4.3.1. Strange little bug--I really wish we could find a solution for it so we could use Master Audio for all our looping ambient sounds in WebGL. It would be a lot nicer.
|
|
|
Post by DarkTonic Dev on Jun 5, 2020 0:16:08 GMT
Isn't that a Unity bug? I can't fix that. Did you try my previous suggestion?
|
|
|
Post by bigbrainz on Jun 17, 2020 19:54:22 GMT
I think it's actually a WebGL issue. I'm just updating to 2019.4. I'll test it there and keep my fingers crossed!
|
|
|
Post by DarkTonic Dev on Jun 17, 2020 22:02:33 GMT
Ok let me know. Not much I can do about either one though.
|
|
|
Post by Racines on Jan 22, 2021 16:36:56 GMT
Hello, I have a similar issues with Unity 2019.3.13f1 and Master Audio: AAA Sound v2020.3.6 for Webgl build.
In my case I loop a playlist using crossfade transitions. When I have the focus on the web page everything works as expected, but when the page loses the focus then the crossfade is ignored. It's really annoying.
I have noticed that when there is no focus, my network events are sent every seconds instead of more frequently. So I guess navigator reduce frame rate dratically (maybe 1 frame per seconds?) I don't know how the crossfade works in MA, but maybe it's related to a very low frame rate, or a deltatime related problem?
|
|
racines
New Member
Posts: 7
Posts: 7
|
Post by racines on Jan 22, 2021 16:40:06 GMT
(I created an account)
|
|
|
Post by DarkTonic Dev on Jan 22, 2021 17:07:22 GMT
Everything runs the same regardless of platform, so I expect this is a Unity Bug. Can you submit it to Unity?
|
|
racines
New Member
Posts: 7
Posts: 7
|
Post by racines on Jan 26, 2021 15:38:28 GMT
After some investigation, this is not a bug of Unity. As noted in this documentation: docs.unity3d.com/2018.3/Documentation/Manual/webgl-performance.html"browsers may throttle content running in background tabs. If the tab with your content is not visible, your content will only be updated once a second in most browsers." So there is only 1FPS when user don't have focus on the webgl page. Causing the crossfade to be ignored. I can reproduce this behavior in the editor by using: Application.targetFrameRate = 1; (I recommand you to not set it without automatically reset it's default value after few seconds, because it also change the framerate of Unity editor too... causing difficulties to stop/pause the game) Can you find a solution to make the crossfade works even at 1 FPS?
|
|
|
Post by DarkTonic Dev on Jan 26, 2021 17:34:09 GMT
Good find!
It should work if you turn on "Gapless Music Switching" under Advanced Settings, because that schedules it ahead of time.
Let me know if that works and I'll update the docs if so.
|
|
racines
New Member
Posts: 7
Posts: 7
|
Post by racines on Jan 27, 2021 12:35:42 GMT
Before enabling this option, it's working with crossfade as expected when I don't change the FPS to 1. But when I turn on "Gapless Music Switching" it seems to not playing the next music, It stops the playlist after the 1st music have been played. (still in normal condition) Also I guess this options will not help to have crossfade working at 1FPS? (I saw an error message when enabling "Gapless Music Switching" that force me to set crossfade time to Zero)
I am looking for having crossfade to works even at 1 FPS, this is the only problem I got when running at 1FPS.
|
|
|
Post by DarkTonic Dev on Jan 27, 2021 17:23:27 GMT
Thanks for the update. I have 2 other things to fix so I probably won't be looking into this until next week. I'll report back.
|
|
|
Post by DarkTonic Dev on Jan 28, 2021 0:12:03 GMT
Ok, I'm going to need you to send me a .unitypackage file with a Scene that reproduces the problem. You can add a button that changes the frameRate if you like or I will. You can make the package out of Example Scene #1 included with Master Audio if that works the way you want.
I don't want to spend days trying to get it to reproduce and going back and forth with you.
I don't know if crossfading can actually be fixed with 1 frame a second. I will give it a shot if we get the issue happening over here.
|
|