chunik
New Member
Posts: 17
Posts: 17
|
Post by chunik on Oct 18, 2021 16:05:35 GMT
Hey, I've been using asset for cca 2 months, adding just simple UI sounds. Unity 2020+
Here is couple of issues i encountered:
-Sometimes sound preview buttons are not working in editor. Just no sound playing happens. I hit playmode in editor and it works, and then it works even if i leave play mode. Until it brakes again, however it doesn't happen after every code recompile, so i can't reproduce, or pinpoint how it happens. It's completely non factor of an issue for me personally.
-Audio organizer did import sound groups correctly but for some reason it set all voices setting to 1.. was super annoying, i just use dynamic sound creator on my prefabs now instead.
-So as probably most users i have some sound packs i've downloaded, and ofc i don't know what "click sound" or "hover sound" to use so i select sometimes up to 20 good candidates, add them to the group and test them one by one. Would be better if the asset could react to voice setting change at run time so i don't have to leave play mode..
-I'm not experienced coder, and i hadn't looked over your code much, but you seem to use GameObject.FindObjectOfType(typeof(MasterAudio) to find your instance when it's null, which is a bit worrying, if you might have thousands of objects in a scene. There might by legacy issues etc that i don't understand, but wouldn't it be simpler if your script on awake/start just sets itself as an instance (in awake you start again with var mas = FindObjectsOfType(typeof(MasterAudio)) ?
Something like (pseudo code).
Awake(){ if (_instance!=this){ instance.ProcessClosingUp();
} _instance = this; ...rest of the code... }
Anyhow none of these issues are braking for me, i can see that supporting the asset is a nightmare, i'll post review once i get to test out music and stuff. So far i'm very satisfied customer.
Thx for the good work.
|
|
|
Post by DarkTonic Dev on Oct 18, 2021 17:33:04 GMT
Thanks,
I haven't seen the preview button not work. If you could send me a sample scene that sometimes shows the issue, maybe I can figure it out.
What is "Audio organizer"? Do you mean Sound Group Organizer game object? I'd like to know where the issue is and see about fixing it.
I'm not sure what you mean by "react to voice setting change", however you could preview all your 20 sounds after adding them to the group and BEFORE hitting play, then you wouldn't have the issue.
As far as the FindObjectOfType calls, I don't believe there's a good way to fix it. If there was an event prior to Awake, we could use that to add to the Instances collection and check it during awake. Otherwise we need to find ALL of them and destroy one. This supports having a Master Audio game object in every Scene and also persisting it between scenes. However we need to actually set up everything during awake, so we can't "register" during awake as the other instances would not be done registering by that time. It's a weird problem. Anyway, it doesn't get called unless it's null, which normally doesn't happen as that is figured out during Awake.
-Brian
|
|
chunik
New Member
Posts: 17
Posts: 17
|
Post by chunik on Oct 18, 2021 18:43:17 GMT
Hey Brian.
-Preview buttons not working. It's a complete mystery to me but it's been there from the first time i downloaded the asset, and i had 0 sound work done before. Here is a video i recorded ( i thought i had braking bug with dynamic sound groups, but i found the bug in my serializable string just as i was recording, so you can ignore like the rest of the vid, just first minute is important). I always thought it's because of my domain reload being turned off, and you probably hold something as static and it's not reseted until play mode or something, but i turned domain reload on, and it was still happening.., can't pinpoint to anything that might be an issue on my part. ¯\_(ツ)_/¯ vid: youtu.be/OQuYh--Hy9Y
-Sound Group Organizer. It was like a month ago so as i recall it it was like this. I make separate UI thingy in a blank scene, it has some sounds, so i work until it's done, and make a prefab out of new UI thingy etc. And i find out, oh i also need to migrate sounds to base scene somehow. So i look around, you have this Sound group organizer thingy, i click some buttons and it fills it out from MasterAudio in a temp scene where i was building separate UI thingy. I mouse drag sound group organizer into project resources to make prefab out of it. Then in main scene i drag the prefab back out, and press some buttons to import/export the sounds into MasterAudio in main scene, and i succseed, but voice settings on sound variations that i imported were set to 1. Idk if i did something wrong in the process, i corrected it by hand, and made a note to myself to not use sound group organizer in the future
- Well i have let's say 20 candidates for button hover sound on that button. I ofc can preview them in editor, or from my disk with vlc etc, but i want to test out how they feel when you hover the mouse over grid of buttons/icons ( i have a lot of those ), so i find the one that feels right. So what i do is i set 19 sounds voices to 0, and 1 sound to 5. I hover the buttons if it feels bad, i delete it and repeat with the next sound. If it feels good i adjust the volume, give it random pitch variation and try again etc, then i just set voices to 0 and try next sound. When i run all of them.. some i delete some i keep i start the process again until i have the right sound, then i sleep on it, and next day try again to see if i feel the same . Anyhow if i enter play mode, and adjust voice settings at run time in the editor it doesn't seem to react, it will still happily play sound that is currently at 0 voices, which may be a bug on my system, or maybe it's not implemented idk..
About singleton instance.
So imagine a static class:
public static class MasterAudioReferenceHolder { public static MasterAudio MasterAudio; [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] public static void ThisMethodWillBeCalledOnceAtTheStartOfTheProgram() { MasterAudio = null; } }
So this thing will be called before any awake it will be one of the first methods in the program possibly before any unity code is executed, so the static class is loaded and waiting.
Now some time later first scene will be loaded that MasterAudio is part of. Unity will call Awake() on it.
If (MasterAudioReferenceHolder.MasterAudio !=null){
MasterAudioReferenceHolder.MasterAudio.ThisIsAnotherMasterAudioPleaseResolveTheConflict(this);
} else { MasterAudioReferenceHolder.MasterAuidio = this;
}
So the first one loaded is the one that gets registered, and each new scene or whatever happens to have new instance that appears will go to previous instance and handle the conflict however you wish to handle it..
Anyhow this is how i do it with my master object manager classes that have a presence in the scene, they go to big static bookeeper class that keeps track of them and they register themselves there. And managers that aren't monobehaviors and don't live in the scene are created in ThisMethodWillBeCalledOnceAtTheStartOfTheProgram() in the order i need them to...
Cheers.
|
|
|
Post by DarkTonic Dev on Oct 18, 2021 18:51:31 GMT
Hi, so about the Voices field during runtime - that one isn't going to be fixable. The value of the Voices field is used to create clone Game Objects during startup (1 for each Voice), and only during startup. Setting the Voices to zero at runtime will not delete them or anything. I'll look into the other answers you gave later on and report back.
Thanks.
|
|
|
Post by DarkTonic Dev on Oct 18, 2021 19:54:45 GMT
Ok, I've fixed the Sound Group Organizer bug. Strange that no one has reported that one, the code has been out there forever!
|
|
|
Post by DarkTonic Dev on Oct 18, 2021 20:00:11 GMT
Yeah I really have nothing to go on for the preview not working one. I haven't seen it happen and I've tried a few things. Installing MA in a brand new project, etc. If you could figure out how to get it to happen reliably I'll give it a shot.
Lastly, I will try your singleton code and let you know if it works for me, thanks!
|
|
|
Post by DarkTonic Dev on Oct 26, 2021 19:51:07 GMT
I've got the FindObjects call in Awake of MasterAudio.cs working with your method. However the one in Instance property won't work because PlaylistController.cs calls that property during its Awake, which happens prior to MasterAudio's.
You are welcome to try and get it working in your build and send me the code if you like.
Thanks, -Brian
|
|
chunik
New Member
Posts: 17
Posts: 17
|
Post by chunik on Oct 27, 2021 5:38:04 GMT
I'm sure there is a way to solve it. I've never even had to use find objects of type in scene yet, there seems to always be a better way.
I'll make a note to look into your code in the future if i find the time and energy, i'm solo making my game so there is always a ton of work to do.
|
|
|
Post by DarkTonic Dev on Oct 27, 2021 15:09:21 GMT
I hear you. Thanks!
|
|
|
Post by hipsterdufus on Nov 19, 2021 23:42:23 GMT
Just wanted to add - I also had the issue with previewing sound effects. I just downloaded and added the asset to my project and the preview sounds button wasn't doing anything. I noticed that the sounds would play after I pushed the play button in the editor and after I closed Unity the sounds would play (very strange). After I restarted Unity I still had the same issue. But today when I turned on my computer and opened Unity it's working without any changes. We'll see if it continues to work.
I also noticed changing number of voices at runtime doesn't do anything which I agree is a little confusing.
|
|
|
Post by DarkTonic Dev on Nov 20, 2021 20:27:41 GMT
One of our users actually gave us reliable steps to reproduce this issue and it has been fixed for the next release. The part about previewing not working sometimes. However the next release is a paid upgrade.
|
|