|
Post by bigbrainz on Jul 3, 2019 18:57:19 GMT
OK, so in our WebGL build we're having problems with looped sound effects not continuing to loop.
It appears that if we click off the Chrome window it pauses the whole game. When we come back, the whole thing resumes, but once any looping audio finishes playing it stops.
I made sure I'm on the latest build, and although it looked like that latest release fixed something similar, it didn't fix this issue for us.
What makes it tricky is that we can't reproduce it in the Editor. And we're not getting any errors in the Chrome console.
It is not a problem for SFX that get triggered as the game goes along. And it is not a problem for looping sounds where it is choosing among 3 or 4 different loops each time it starts over. As far as we can tell it's only individual loops that we're telling to keep looping forever. This IS happening in scenes loaded from asset bundles if you think that might matter.
Any ideas how we might be able to fix that or work around it? Or even pin down better what the problem might be?
Thank you!
Ben
|
|
|
Post by DarkTonic Dev on Jul 4, 2019 17:48:04 GMT
Sounds like a Unity bug to me. Probably platform specific. Not sure what to do but you could try not using Master Audio and see if it still happens to confirm.
Which bug are you referring to that was fixed recently?
I'm not sure of a reason why Asset Bundles would matter.
|
|
|
Post by bigbrainz on Jul 5, 2019 19:24:52 GMT
OK, so I built a simple test: edtechgames.com/tmp2/looptest/- There's a Master Audio ambient noise loop playing some children on a playground. - Then there's a Unity Audio Source ambient loop of insects in a forest. Both are looping smoothly when you start up. When I click away it pauses the game and the music. When I click back, gameplay resumes and both audio clips resume. But as soon as the Master Audio clip of children playing finishes, it no longer loops. Does that help? Note 1: When I try this test in a completely empty project the test scene doesn't pause when I click away so it's hard to test. To my knowledge we're not pausing it on our end. The documentation just mentions that the browser might throttle it. I suspect it's pausing it because the overall build size of our full game is heavy enough that it's causing the browser to pause our game. Note 2: This is in 2018.4.1f1 Note 3: The bug I thought might be related to this one was (just cuz it seemed related to ambient sounds not playing): - Fixed bug where re-enter mode of Ambient Sound wouldn't play anything after the first trigger enter if set to "fade in same sound"
|
|
|
Post by DarkTonic Dev on Jul 5, 2019 19:38:41 GMT
Are you using the Ambient Sound script or not? That bug fix was for the Ambient Sound script. If you're not using it, it's unrelated.
If you can't reproduce it in the editor, I'm not sure how we can help to debug it unfortunately. We have no platform-specific code at all. I believe you will need to log some things to the Console to debug further (assuming you can read the console or remote debug on the platform).
Can you take a screen shot of the Sound Group's settings in the Inspector? Did you try it without Asset Bundles?
|
|
|
Post by bigbrainz on Jul 5, 2019 20:51:42 GMT
Yes I'm using the Ambient Sound Script. Attached are the settings. Yes I tried it without asset bundles. Same problem. Also attached are the settings for the sound group and the loop itself. This time I tried an ambient sound connected directly to the MasterAudio component and a second one using a DSGC (the weird voice sfx). Both of them stop looping once the game loses focus. The Unity Audio Source keeps going: edtechgames.com/tmp2/looptest/ Hopefully you'll see something dumb we've done. Thank you!
|
|
|
Post by DarkTonic Dev on Jul 5, 2019 22:58:05 GMT
I don't see anything weird.
I would like you to try it without the Ambient Sound script. Instead use Event Sounds script with "Enabled" event. Ambient Sound has a bunch of ways to stop the sound that include going on out audible range, and I want to see if it might be that.
|
|
|
Post by bigbrainz on Jul 5, 2019 23:16:46 GMT
Argh . . . no luck. Hmmm . . . I'll see if I can think of anything over the weekend!
|
|
|
Post by DarkTonic Dev on Jul 6, 2019 2:00:39 GMT
It's weird because it's just a looping Audio Clip on an Audio Source. It shouldn't stop unless MA tells it to stop. Does the voice still show as playing on the Mixer section in Master Audio when it stops? Or it is zero voices? Did you turn on "Log Sounds" in Advanced Settings and see what all gets logged to the Console when it stops looping, if anything? That may give us a clue if it logs something.
|
|
|
Post by bigbrainz on Jul 8, 2019 17:27:45 GMT
Yes we turned on Log Sounds. But it's not printing anything to the console. A helpful debug would be if we could print out the # of voices and their volume maybe. Is there a way we can output that kind of info? For this test we'd probably want to just write a script that would output that every second or so. Where they are in the clip might also be helpful so we can verify if it's progressing through the clip.
We're also looking to write a script that will just check to see if they're playing and if not, trigger them . . . ? (As we work on that script, can you answer why the volume is being set as lower than what's set when I call the "MasterAudio.PlaySound3DFollowTransform(soundGroupName, sourceTransform, volume);" method.)
|
|
|
Post by DarkTonic Dev on Jul 8, 2019 23:44:53 GMT
Yes we turned on Log Sounds. But it's not printing anything to the console. A helpful debug would be if we could print out the # of voices and their volume maybe. Is there a way we can output that kind of info? For this test we'd probably want to just write a script that would output that every second or so. Where they are in the clip might also be helpful so we can verify if it's progressing through the clip. We're also looking to write a script that will just check to see if they're playing and if not, trigger them . . . ? (As we work on that script, can you answer why the volume is being set as lower than what's set when I call the "MasterAudio.PlaySound3DFollowTransform(soundGroupName, sourceTransform, volume);" method.) Well you can view in the Mixer section how many voices are playing, then you can click into the Group's Variations to see their volume if any are playing - it also shows the clip progress as a slider if you click "select caller" there. Just use the Inspector. This page of the documentation shows what I'm talking about. www.dtdevtools.com/docs/masteraudio/Troubleshooting.htmI'm wondering whether Master Audio thinks they stopped or doesn't know they stopped (and still shows them as playing). I can write you a script to enumerate through the playing voices but try that first to see what's up.
|
|
|
Post by bigbrainz on Jul 9, 2019 16:34:03 GMT
The trick is that it's not doing it in the Editor, so we have to debug it to the Chrome browser console in WebGL. In the meantime, we've gotten it to sort of work using a brute force script that just checks to see if the SFX is still playing and if it's not, it starts it up again. One problem with that is that it leaves an abrupt stop/start every time the loop starts over. I'll try to send you a copy/explanation of that privately in case it helps you either see a better fix on your end or somethign that will help us fix it better on ours.
Thank you so much for all your help!
|
|
|
Post by bigbrainz on Jul 9, 2019 19:05:51 GMT
BTW . . . he's thinking of adjusting our workaround so that it retriggers the master Audio loop (if he detects it's not playing) rather than takes over playing it. If you have an insight about how he can access that call, that would be helpful.
|
|
|
Post by DarkTonic Dev on Jul 9, 2019 19:28:18 GMT
Replied to your email. Thanks!
|
|
|
Post by DarkTonic Dev on Jul 9, 2019 19:29:16 GMT
BTW . . . he's thinking of adjusting our workaround so that it retriggers the master Audio loop (if he detects it's not playing) rather than takes over playing it. If you have an insight about how he can access that call, that would be helpful. You could do that from the Variation's Audio Source, but unfortunately Master Audio wouldn't be tracking it properly so I don't suggest doing that. In other words, it probably wouldn't show as playing and the voice count would be wrong.
|
|
|
Post by bigbrainz on Jul 10, 2019 18:19:38 GMT
OK, no luck. Unfortunately we didn't have any luck getting any kind of debug sent out. It appears that Master Audio might think its still playing the audio. Or maybe we're just not tapping into the info correctly.
Regardless, we're just going to change our script to switch all our ambient, looping SFX to use a normal Unity Audio Source. It's a brute force fix for now, but it means we could fairly easily turn it off and just use pure Master Audio if we can ever find a genuine fix.
Thanks for your help.
|
|