|
Post by CJY9 on Apr 27, 2022 18:17:50 GMT
darktonic.freeforums.net/thread/1295/soundgroup-attribute-play-sound-editorHi. It's about the same issue with the above mentioned thread. I failed to mention it in the past thread, but the error did come back after the code change in the old version. The code changes did prevent that no-sound-is-played-in-editor issue, but only sometimes. (As opposed to 100% not playing after a minute of inactivity, so that was still an improvement). On this Unity Asset Store's asset I saw the 2022 version of the Master Audio being on sale. While I wasn't thinking about the upgrade, I noticed this line on the release notes: "- Fixed bug: Previewing in edit mode would randomly stop working after 1 minute of inactivity." It appeared to me that the definitive solution was found to fix the issue, so I purchased the new version of the asset. Getting rid of that inconvenience alone would have been worth it for me. However, the issue's still there. I can circumvent it by compiling my codes or enter play mode to "reset" it, but I do hope that this issue will be permanently fixed some day. I'm currently using Unity 2020.3.33f1 Personal <DX11> and Master Audio 2022: AAA Sound 1.0.1 version. Thanks,
|
|
|
Post by CJY9 on Apr 27, 2022 18:34:01 GMT
Oh, looks like I can't edit the post as a guest. I thought I mentioned it but it appears I didn't. So here it goes.
I think the issue is happening with Dynamic Sound Group Creator (prefab). While I was adjusting / setting up sounds for my scriptable objects using [SoundGroup] edit folder, I had a scene named "SOUND SCENE" opened. In there, there's the master audio with all the game-wide sounds inside the prefab, and all Dynamic Sound Group Creator prefabs which are meant to be dynamically loaded on specific or certain scenes only. But for sake of assigning sounds to scriptable objects, they are all there, dozens of them.
I noticed that the issue only happens when I play a sound in the dynamic sound group creator prefab, but never when I try to play the game-wide common sounds that are already inside the master audio prefab. Maybe the dynamic nature of DSGC have to do something with the sound being queued until compile/play mode? I don't know. Thought this might be a help in investigating the issue, so I leave it here. Sorry for all the whining; have a great day!
|
|
|
Post by DarkTonic Dev on Apr 28, 2022 2:30:46 GMT
That's worrying to hear. Thanks for letting us know.
Can you either give me exact steps to try and reproduce it, or send me your example Scene that makes it happen, with instructions? I'll give it a shot and see what happens on my end. Not sure I use scriptable objects or know what they are.
Thanks, -Brian
|
|
|
Post by CJY9 on May 10, 2022 23:01:46 GMT
I thought I explained it in the second post, but I'll try to be clear this time around.
1) Build an empty scene.
2) Put a Master Audio prefab in it, with or without some sounds assigned to it. Audio already inside Master Audio works just fine... in fact, playing an audio inside Master Audio prefab will clear the issue and make DSGC sounds playable again for awhile.
3) Create a dynamic sound group creator (Script) prefab and add some sounds in it. (1) FIRST ENABLE ONLY. (2) FALSE on Error On Duplicate Items. (3) TRUE on Auto-create Items. (4) TRUE on Auto-remove Items. (5) No Ducking. (6) An audio clip inside Dynamic Group Mixer with an existing bus (Named "Spell" in my case). Save them as prefabs in your project. Still, leave them inside the scene.
4) Have a variable of string after [SoundGroup] somewhere on your monoBehaviour, or scriptable object. You just need to be able to see it.
5) See the variable in the inspector. Even if the audio is inside Dynamic Sound Group Creator (Script), you can see the said audio's name in the drop down menu. Click onto that. To the right of the drop down menu is a cog, a speaker, and a square.
6) Press middle speaker button to hear the audio. Sometimes it works, and sometimes it doesn't. This is where the inconvenience is. When sound is not playing (stuck), I can see a yellow speaker icon right next to Master Audio prefab, and it won't go away. Normally, you'd see the yellow speaker icon while the sound is being played, and collapse into nothingness when the sound is over. That doesn't happen when the error happens.
If you still can't reproduce the issue, maybe I can make a scene and send it to you like you suggested. Let me know, thanks,
|
|
|
Post by DarkTonic Dev on May 10, 2022 23:29:46 GMT
Where do you see the speaker icon? Scene View, Hierarchy?
I got it to reproduce once, but as you said it goes away once I play a non-DGSC sound. How to make it break again after that?
-B
|
|
|
Post by CJY9 on May 11, 2022 16:53:06 GMT
I see the speaker icon in the Inspector? There's obviously Game Object, its Transform, and my custom monobehaviour below with its script name greyed out. Then, below that is TestSound(variable name) [DropDownMenu v] [Cog] [Speaker] [Square].
Anyhow, it breaks again when there has been a minute or two of inactivity (playing no other sounds). Maybe I should add that I was not focusing on the Unity project. I was browsing news or other sites for few minutes and then checked if it broke again. Just now, I was able to "break" it three times in a row after resetting it with playing a sound from MasterAudio.
|
|
|
Post by DarkTonic Dev on May 11, 2022 20:09:45 GMT
Ok thanks, I've narrowed it down, and it doesn't work because sometimes PlayOneShot just doesn't work (Unity bug). If I assign the clip to the Audio Source and do .Play() it never fails. We want to NOT do that because non-Audio Clip such as resource files and Addressables may not unload their memory correctly when you leave edit mode. So I'm really not sure how to fix this. Maybe I should submit a bug to Unity?
We could also play it like this, but there's no way to stop it playing, which makes it seem unusable.
AudioSource.PlayClipAtPoint(rndVar.VarAudio.clip, MasterAudio.ListenerTrans.position);
Please advise.
-B
|
|
|
Post by DarkTonic Dev on May 23, 2022 20:55:32 GMT
Ok, I figured out a way to fix this bug. It will be in the next update, probably this week.
|
|