Search Unity

Master Audio - AAA Sound Solution. #1 audio plugin on Asset Store!

Discussion in 'Assets and Asset Store' started by dark_tonic, Jan 28, 2013.

  1. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That might work for a game with 2D sounds, but if you want 3D sounds that will not be acceptable. You doing a 2D audio game? Where the sounds aren't directional?
     
  2. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    Oh, you are right, I forgot that...
    I am doing 3D game, but my additional scene only contains the "Inventory UI", so I only need 2D sounds in additional scene, and these sounds don't need be directional.
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok. I will need to spend some time with an additive loading Scene and see how it works when I have time. However I believe my previous advice was correct. Doesn't sound like you tried it.
     
  4. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    Ok, thanks for reply.
     
  5. cybersoft

    cybersoft

    Joined:
    Feb 12, 2014
    Posts:
    107
    Hi,

    I have found one asset Native Audio that should be very helpful for mobile devices in order to reduce audio latency.

    Could it work with Master Audio together?
    Do I really need this plugin if I have bought Master Audio?

    How does handle Master Audio the audio latency on mobile devices?
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Together: very doubtful.
    How we do handle Android latency? We don't, it's on the roadmap to add something like this to the product. iOS and other mobile devices don't have latency, just Android.
     
    cybersoft likes this.
  7. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    I have question regarding best practices. I'm using MasterAudio in conjunction with Vegetation Studio Pro to create a dynamic soundscape without pre-cooked ambience sound files. Basically, VS Prio places GameObjects with AmbientSound components in trees, bushes and other objects. These play various bird, insect and environment sounds. There are a number of SoundGroups called DayTree, DuskTree, NightTree, DawnTree, DayPlant, DuskPlant, etc – you get the idea. All sounds are looping sounds, polyphony is capped per group, distance priorities are calculated, etc.

    To select among the available SoundGroups, there's a component attached to the same GameObject to set the name of the SoundGroup:
    Code (CSharp):
    1. using System;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using Zenject;
    6. using DarkTonic.MasterAudio;
    7.  
    8. public class AmbienceNode : MonoBehaviour
    9. {
    10.     public AmbienceSettings.VegType vegType;
    11.  
    12.     [Inject]
    13.     private AmbienceSettings ambienceSettings;
    14.  
    15.     private AmbientSound ambientSound;
    16.  
    17.     private string soundGroup;
    18.  
    19.     private void Awake()
    20.     {
    21.         ambientSound = GetComponent<AmbientSound>();
    22.     }
    23.  
    24.     void OnEnable()
    25.     {
    26.         soundGroup = ambienceSettings.SelectAmbientSoundGroup(vegType);
    27.         ambientSound.AmbientSoundGroup = soundGroup;
    28.     }
    29. }
    30.  
    The AmbientSoundGroup must be set using OnEnable as the GameObject is pooled by VS Pro. However, it seems it's too late, as no sound will be produced the first time the field is set. The second time the GO is enabled, the value in AmbientSoundGroup will be used, but then it's of course the previous value.

    So my question is: is there a method to reselect and play a variation from the given SoundGroup?

    I also need to change the SoundGroup later, when the time of day changes and day becomes dusk, etc. Ideally in that case, the best approach would be to let the current variation play until its end, only then selecting from the new SoundGroup. This way, the transition will be gradual.

    Any ideas on how to do this?
     
    Last edited: Nov 5, 2018
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Let's solve one issue at a time. Firstly, I would just disable the AmbientSound components (or the entire game object they are on) until after you set the sound group so it won't be too late (I think). Set the sound group, then enable the object. Most likely your Script Execution Order is running the Ambient Sound OnEnable before the one you're using. You could also potentially fix it by putting that script into Script Execution Order before AmbientSound script, but that might screw up your other system...

    Let me know if that works and then re-ask any other questions remaining.
     
  9. misanthropowitsch

    misanthropowitsch

    Joined:
    Sep 30, 2016
    Posts:
    23
    Hello @jerotas

    I recently purchased your asset and tried to make it work with platformer pro. I encountered a series of problems though. I can´t make the event sound respond to anything besides enable (for example shooting projectiles) I guess it has something to do Platformer Pro being raycast based instead of regular 2D collision? Makes me wonder though, because in the platformer pro forums someone said, your asset works great with platformer pro. Did you ever have a customer who combined the engine with master audio?

    Best,

    Dominik
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If it uses Ray Casts, yes, that won't trigger anything in Event Sounds script. It's extremely rare that fellow users respond to other user questions in this forum just so you know. I haven't heard from anyone using Platformer Pro so I can't advise. You may need to ask the Platformer Pro for advice on how to play sounds (just where to put the code) when things are hit from a Ray Cast, if at all possible.
     
  11. misanthropowitsch

    misanthropowitsch

    Joined:
    Sep 30, 2016
    Posts:
    23
    Thanks for answering that fast. I was afraid of an answer like this..

    What a letdown.. :( Bought the asset and now it´s basically useless for my case, although it´s great at what it does.
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It depends on what Platformer Pro author has to say. If he can tell you where to insert code, it will be only 1 line of code to play SFX or anything else. Non-coders can handle it.
     
  13. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Got this error on build:

    A script behaviour (probably DarkTonic.MasterAudio.MasterAudioSettings?) has a different serialization layout when loading. (Read 52 bytes but expected 116 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?

    Any fixes?
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I don't use serialized properties at all. We changed the serializations to one thats supposed to work on all platforms a couple years ago. I'm not sure how to reproduce your error. Please state platform, OS and unity version.
     
  15. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    A scriptable object called MasterAudioSettings is generated under the Resources\MasterAudio folder every time I click on MasterAudio's prefab.
    It can be regenerated even if I deleted it.
    upload_2018-12-6_19-5-6.png
    CleanResources folder

    upload_2018-12-6_19-5-56.png
    Generated the file after I click on my master audio prefab in scene.

    I just updated my master audio into the latest version (4.2.0)
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ah right. That's got a few properties in it. You didn't let me know how to reproduce your error: unity version, OS and platform. I'm not going to be able to help until I can make the problem happen on my end.
     
  17. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Can I change song when entering a trigger zone on scene? Like entering woods, plays "song Woods" ? How?
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sure. You need a trigger (collider) that you can check when the player enters. Then use Event Sounds, Trigger Enter event, set Action Type to "Playlist Control" and use Playlist Command of "Play Song". Then specify the song.

    I would use the layer / tag filter to whatever your player is in so it won't trigger for other things hitting the trigger.
     
  19. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    In my project, just clik on the master audio prefab in the scene, this file get generated. I have to delete it each time before I build a game.
    I'm using unity 2018.2.16f1 and build for windows platform
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I just did a test export of 2 Scenes with 2018.2 to windows platform just fine. And I have the resource file. I can't reproduce what you're seeing at all. In fact, no one has reported this issue before.

    What is your operating system? Are you on a Mac?

    I have no idea how to fix the issue if I can't reproduce it. Do you have an idea?
     
    Last edited: Dec 10, 2018
  21. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    My operation platform is windows 10. Does the file matter if I delete it when build? cuz this action can solve that error.
    And the fact that you create a scriptable object within the mark #if UNITY_EDITOR is not recommended. And the scriptable object even got send into the resources file, meaning it will be serialized by unity, but after build, this whole script will not exist in the compiler. This is the source of this error, unity cannot read or identify this serialized object.
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I have a Windows 10 computer that I can check this on tomorrow. I don't think it matters where I create the scriptable object. You could have created it yourself. I'm just making it easy for the user. The scripts that load and read it also check if they are in the editor so it's really should not matter.

    It is definitely safe to delete it whenever you want however you will lose all the settings that are in it. The reason the file exists is so you can check it in and share those settings across other members on your team instead of everyone having to make the same changes separately.
     
  23. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Maybe you can move the directory out of Resources so unity won't include them in the build? The error is not related to your calling methods but unity found an unknown serialized object which even without a class in the build.
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It's in Resources folder on purpose, so that it can be loaded where you decide to relocate the file (as long as it's in Resources folder with any parent folder).
     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I gave it a shot on my Windows 10 computer and still a no go. I got no errors of any sort when exporting to PC standalone, with that resource file as well. If I can't reproduce the problem I probably won't be able to fix it.

    Have you tried opening a brand new project and importing Master Audio, then building for that platform?
     
  26. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Not yet, but I can solve this by deleting the file before build, so it can work for me now, thank you for the help :)
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok. I spoke wrong. The file is used for settings that aren't held in the Master Audio prefab, because they are shared among all Master Audio prefabs (global settings)
     
  28. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    20181219212338.png

    MasterAudio added from the Master Audio Manager window does not work in 2018.3.0f2.
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Make a prefab out of it and those warnings will go away in edit mode. But it will still show that way when you hit play, which sucks.

    I have it fixed and will release this week. You can email us your asset store invoice PDF for the beta if you don't want to wait.
     
  30. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    V 4.2.1 is live. Changelog:

    • Fixed bug: Ambient Sound Collider was wrong size sometimes.
    • Fixed bug: Ambient Sound "follow nearest collider" setting didn't process as many per frame as you selected.
    • Fixed bug: Unity 2018.3 beta will strip away most of the Audio Source Templates and Group Templates so you can't create Sound Groups. Added buttons to recognize missing templates and a button to add all.
    • No PlaySound methods return a null PlaySoundResult object now, so no need to check for that.
    • Added "Trigger Re-Enter Fade In Time" to Ambient Sounds, and a volume field as well.
    • You can now use loop with custom start position, as long as the custom end position is 100%. Looping will go back to the beginning of the clip.
    • We no longer try and detect if you're in Project View mode for sub-game objects, because it leads to extra workflow in Unity 2018.3.
    • Resonance Audio buttons to add Resonance Audio Sources to all Variations is now a checkbox, and it now adds them to Groups created later and by DGSC's.
    • Added integration for "Oculus Integration" plugin on Unity Asset Store. ONSP Audio Sources can now be added automatically to every Variation by clicking a checkbox in Advanced Settings / VR. You must install optional package "MA_Oculus" to get this. Move Oculus folder from Assets to Assets/Plugins, then move all files in any Editor folders inside that to Assets/Plugins/Editor/Oculus (create the folder).
    • Fixed warning in Unity 2018.3 about deprecated WWW object.
    • Fixed 2018.3 Inspectors - could not be used at runtime.
     
  31. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    OK, thanks for reply.
     
    Last edited: Dec 19, 2018
    jerotas likes this.
  32. igorgritsay93

    igorgritsay93

    Joined:
    Dec 21, 2018
    Posts:
    5
    Hi! I have several questions regarding Master Audio:

    1. In Unity 2018.3 they've added new prefab system. Will you add support for it in Master Audio in future updates? If so, when do you think you'll be able to?
    2. We've made some internal solution for various object material types: wooden/concrete floor steps, metal/wooden fence climbing, etc. Maybe there's some built-in solution in Master Audio that will allow playing different sounds based on target object's properties?

    Thanks!
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    1. Already done and update submitted. If you need the update and don't want to wait for it to be approved, email us with your invoice PDF.
    2. Sounds like a footstep system based on dominant material? Or are you talking about something else? Give more details.
     
  34. igorgritsay93

    igorgritsay93

    Joined:
    Dec 21, 2018
    Posts:
    5
    Thanks, we'll wait for approval, it's not critical at the moment.
    Yes, you're right, but not only for footsteps. Right now we assign a material tag for floor surfaces, so that we can play the right sound. But maybe Master Audio has something like that already.
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If you have tags then you can use our Footstep Sounds script. I don't have anything for dominant material that's ready for release but tags are a go.
     
  36. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    144
    Hi there, great great asset, it's been a blast setting it up.

    I have a small problem though. Is there a way to start a sound when an object is destroyed, but not when it's disabled ?

    I have a case where my objects need to be off the screen for a little while and the destroyed sound plays on invisible when they just get disabled.

    I know that the disable event would be triggered when the object is destroyed, but the problem is that it's also triggered when the object gets disabled and so I have a conflict on my scene, which causes a sound to happen when the object just gets disabled.

    As a last resort i could probably make them non interactive and reduce their alpha to 0 i guess, but i have quite a few of them and it will be a bit slow i think.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If you're using a Pooling plugin (PoolManager or PoolBoss) then you can use "Despawned" event, otherwise you won't be able to use Event Sounds. You'll need to add a script of your own for code in the OnDestroyed event, which is a 1-liner.

    If you're not using pooling, why not? It's necessary for performance in my opinion, even if you're not doing mobile platform. I've shipped a few games and pooling is the very first plugin I install - and Master Audio.
     
  38. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    144
    Ahh, I see. I am getting poolboss now then, I just wasn't aware of that option. I am assuming i would then need to add like a custom OnDestroyed event ? Or does the MasterAudio plugin automatically do that ? I'll try that shortly, thanks !
     
  39. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    144
    Hmm, I am seeing how poolboss works now, looks like it's preloading prefabs. Very useful, but probably won't work in my case because my objects are dynamically created once the level loads and i really don't want to go through the hassle of grabbing the poolboss clones now and setting them up for the scene, too much refactoring needed there. I will definitely look to use that in another project though, makes a lot of sense. Maybe i'll have to work my way around the despawn/disable audio issue.
     
  40. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Pooled objects are never destroyed unless the Scene is destroyed because that causes garbage collection and unsteady frame rate when it happens.
    It has an OnDespawned method that Master Audio supports in Event Sounds script.
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    As I said before, you can just add a script like this to do it:

    Code (csharp):
    1.  
    2. [SoundGroupAttribute]
    3. public string SoundToPlay;
    4.  
    5. void OnDestroy() {
    6.     MasterAudio.PlaySound3DAtTransform(SoundToPlay, this.transform);
    7. }
    8.  
    9.  
    That's all it will take. the SoundGroupAttribute decorator will make it so that you can choose your Sound Group from a dropdown in the Inspector.
     
  42. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    144
    Thanks a lot, I'll give it a shot !
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No problem.
     
  44. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    Hey,

    As part of the game's lifecycle, when we restart our game we cleanup the scenes containing all of our game objects, and when that happens I notice this error (only happens once, in that frame):


    Is there a way for us to reset all of the running master audio stuff so that the error doesn't happen?

    Thanks!
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I don't believe you're on the latest version. I think I've fixed that bug already. Update to the latest and let me know if it still happens. Your line numbers in the stack trace aren't lines that can break...
     
  46. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    Hm, I am on 4.2.0 according to the asset store, I even tried completely deleting the master audio folders and reimporting - no changes
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I suggest you email me for the version that's submitted and still not approved. support@darktonic.com
    and include your Asset Store invoice PDF. If you can still get it to happen on that version, we will get the correct line numbers and hopefully have a quick fix.
     
  48. apt-utvikler

    apt-utvikler

    Joined:
    Oct 5, 2018
    Posts:
    5
    Hi, I think I'm missing a preview button for my sound groups. Have tried switching to wide mode. Using Unity 2018.3.0f2.

    EDIT: Can be fixed by prefabbing. Not ideal though.
     

    Attached Files:

    Last edited: Jan 4, 2019
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'm removing the Project View (and prefab) check for the next update. That happens because you're on 2018.3 where the prefab system changed.

    I would argue that every important game object in a scene should be a prefab anyway, to prevent conflict and lost work when more than 1 person works in a Scene. Then then sound designer person doesn't need to affect the Scene, just the prefab when they're fine tuning things.
     
  50. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    Hey, I just updated to 4.2.1 and I'm still getting an error:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. TransformFollower.RecalcClosestColliderPosition () (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/TransformFollower.cs:215)
    3. DarkTonic.MasterAudio.MasterAudio.RecalcClosestColliderPositions () (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:1087)
    4. DarkTonic.MasterAudio.MasterAudio.ManualUpdate () (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:1017)
    5. DarkTonic.MasterAudio.MasterAudio.LateUpdate () (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:1003)
    It looks like this is the line that is causing the problem:
    Code (CSharp):
    1. var listenerPos = MasterAudio.ListenerTrans.position;