Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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
    V 4.1.5 is released! Changelog:

    • Fixed issue: When "save runtime changes" is on, Custom Events, Playlists, Duck Groups and Buses in DGSC's no longer stay in the Master Audio game object after hitting stop.
    • Fixed bug: Relations Inspector didn't show linked groups of linked groups.
    • Fixed warning on Unity_2017 having to do with "Save Runtime Changes".
    • Fixed bug where Mechanim Timed Custom Event wouldn't play timed event unless other unrelated checkbox was checked.
    • Fixed bug where only 1 of an Audio Clip with "Preload Audio Data" could be played inside a single Sound Group at once.
    • Added MasterAudio.DeleteGroupVariation to API.
    • Added "Max Pos. Recalcs / Frame" for Ambient Sounds under Advanced Settings, for use with the new Use Closest Collider Position option.
    • Added a setting in Advanced Settings to turn off the non-gravity RigidBody on ListenerFollower if you don't use Ambient Sounds script.
    • Added logic to not rescan Groups in Master Audio Inspector unless the list of groups has changed.
    • Updated Playmaker Custom Action "Master Audio Play Sound With Event" to have all the options that the Play Sound action has.
    • Added "Use Closest Collider Position" checkbox to Ambient Sound script (Unity 5.6 and up only). This will reposition the Audio Source for the caller every frame to the closest point on the collider of the caller, if one exists. This overrides the "Follow Caller" option.
    • Added the ability to choose top collider, child colliders or both with the Use Closest Collider Position option.
    • Added the alternate "File Player Prefs" for XBox and made it the default for XBox platform. So now you can do Persistent Settings and other Player Pref dependent code on XBox as well.
    • Add a new setting under Audio Listener Settings on Advanced Settings, called Variation Update Method. Defaults to Late Update, but you can change it to Fixed Update if your Audio Listener is on a Physics (gravity rigidbody) object, so audio glitches will be eliminated.
     
  2. ludaregamesgroup

    ludaregamesgroup

    Joined:
    Jan 19, 2016
    Posts:
    4
    Hello! Big fan of this plug-in. I would like to report a couple of issues that I am experiencing. I am using Unity 2017.1.2f1

    Materaudio Bugs.png
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    What's the issue? Does that not compile? It should according to the compiler directive, which is 2017_OR_NEWER.

    I checked the other day and the version I use was still the newest, and had no compiler errors or warnings. I'm 2017.2.0b8. Any reason you haven't installed the latest?

    Have you downloaded the very latest Master Audio, because I released a large update last night?
     
  4. ludaregamesgroup

    ludaregamesgroup

    Joined:
    Jan 19, 2016
    Posts:
    4
    Hi jerotas!
    • I downloaded 4.1.5
    • I cannot use anything higher than 2017.1.2f1 unfortunately. We are using some server technology that is not compatible with 2017.2.0b8
    • Here is the error message.
    Assets/Plugins/Editor/DarkTonic/MasterAudio/MasterAudioInspector.cs(106,46): error CS0246: The type or namespace name `PlayModeStateChange' could not be found. Are you missing an assembly reference?
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Then try taking out all the sections that want Unity 2017_1_OR_ABOVE. Leave the code part that is with "#else"
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Happy Cyber Monday! Master Audio is on sale for half off, and the rest of our plugins are 30% off, for a limited time! Grab 'em while they're cheap if you don't already have them. Links in my signature.
     
  7. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    253
    Hello!

    This was probably asked already, but is there a way to tell a custom event to be fired from a specific location in code? (lol I might have asked this myself some time ago) xD I set up a string of sound groups to play, but I'd like them to play from a specific object. I am unable to add the event script itself to that object, so I am wondering if I can just make an empty object and then tell the event to play for a specific point in space or from a specific other object.

    Thanks.
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Firing a Custom Event takes a Transform component as one of the parameters. It's required and is the "event origin".

    Your receivers can be on any Game Object.

    If it's only going to have one receiver though, probably overkill to use Custom Events.
     
  9. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    @jerotas Hey just wanted to tell you that the Occlusion setting for raycasts hit triggers wasn't actually implemented.

    Here's the fix:

    Code (CSharp):
    1. var oldRaycastsHitTriggers = true;
    2. // ReSharper disable once ConvertIfStatementToConditionalTernaryExpression
    3. if (is2DRaycast) {
    4.     oldRaycastsHitTriggers = Physics2D.queriesHitTriggers;
    5.     Physics2D.queriesHitTriggers = _maThisFrame.occlusionRaycastsHitTriggers;
    6. } else {
    7.     oldRaycastsHitTriggers = Physics.queriesHitTriggers;
    8.     Physics.queriesHitTriggers = _maThisFrame.occlusionRaycastsHitTriggers;
    9. }
    10.  
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thanks, fixed.
     
  11. PurpleSkyD

    PurpleSkyD

    Joined:
    Nov 2, 2017
    Posts:
    3
    Hello, I have a couple of questions about this asset's license.



    First, I am currently working with a single friend and we both want to use this asset on our project. However, we may soon have new people in the team, and some of them might not have to deal with audio at all. Do all of us need to buy this asset so the project stays compatible for all? I don't mind not being able to compile in certain machines, but buying this for several people who won't ever use it is painful.



    Second, my teammate will be buying a new computer soon. Since this license is one per machine, will he be able to change it to his new computer when he gets it?



    Finally, can we ask for a refund if anything goes wrong?

    Please keep in mind we use git for version control.
     
    Last edited: Dec 7, 2017
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Since it's an Editor Extension, the Unity Asset Store says "1 license per seat" which is basically per user. There are some threads around explaining this if you search. It doesn't matter if only 1 person will be "using / tweaking" Master Audio, the code unfortunately needs to exist on every machine once they pull an update from Git. If you don't check in the Master Audio code, all audio and prefabs having audio will be broken so I wouldn't advise that.

    However, no one's going to really know how many copies you purchase, so it's kind of an honor system.
    You don't actually "register" per computer or anything like that. We do have bulk rates which are about the same as the current sale, but the current sale ends tonight. We have sold a number of unlimited team licenses as well as bulk licenses to a number of larger companies over the years, but not as many as you'd think.

    You can refund if things don't work properly and we aren't able to resolve the issue through support. But we've only had a handful of refunds ever because we resolve everything 99.9% of the time, and quickly.

    Thanks!
     
    Last edited: Dec 11, 2017
  13. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    Hi, I've got the same issue and don't want to upgrade yet either. What exactly am I commenting out and where? I tried commenting out the If 2017_1 stuff but this just caused more errors. Unsure if I removed the right code.

    Now I'm being told, "There is no Master Audio prefab in the scene" (which isn't correct).
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There's code like this:

    #if Unity 2017_1_OR_ABOVE
    // Unity 2017 code
    #else
    // Unity older version code
    #endif

    Just keep the stuff between #if and #else. Remove all the "#" directives and the Unity older version code.

    If you don't want to use the fixed version this is your only option. Why would you not want to upgrade? Isn't it mainly bug fixes? You want to work with buggy Unity?
     
  15. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    We're interested in using Master Audio for a game which will have adaptive music (multiple layers of each track, fading those layer in and out based on what's happening at any given moment in the game). The Asset Store description has a line about multi-layered music, but I can't find anything in the docs about how it works in Master Audio. How/where can I find out how that works?
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Basically you can have as many Playlist Controller in the Scene, each playing a "stem" Playlist which synchronized with each other, and you can fade in / out any of them via code or MonoBehavior events, the latter not requiring any code.

    There's a video showing how to set up the multi-layer stuff here, although it's a bit old so the UI probably looks much less nice in the video than now. Here's the vid.

     
  17. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Thanks for the quick reply. That's helpful. I haven't (obviously) looked at the video tutorials -- do those document a lot of stuff that's not in the text docs? I do appreciate how short and to-the-point this video is (unlike many tutorial videos out there!) but I also really like having complete text docs for easier browsing and reference. :)

    From what I could tell in that video, we could use MonoBehavior to play a single track in the multi-layer set...but is it easy to do more complex instructions? For example, we will have a base layer0 that always plays, and then fade in layer1 for 10 seconds, then maybe fade in Layer2 for a bit, then fade out Layer1 while Layer0 and Layer2 continue to play, etc. I'm sure that'd doable by scripting, but it would be great to have events to do all that also.

    thx
    Dave
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The goal of our videos was to be concise and not ramble.

    Both the API website and the documentation website are in this post: http://darktonic.freeforums.net/thread/1/welcome-tonic-master-audio-important

    Yes, on any of the layer you can either start them playing at zero volume or not playing, then later tell them to fade in or play with fade in via script or our powerful EventSounds script that "does it for you based on MonoBehavior events". So you could do that via hitting a Trigger / Collision on a particular tag/layer or becoming disabled / etc. There are almost 50 events you can use.
     
  19. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    262
    Hi Brian,

    I've been using MasterAudio for a long time now and it's done well. Thanks for all the work you put into building and supporting it. We shipped Headmaster for PSVR with it.

    I'm starting a new project and have a basic question that I've never really been able to understand the right answer to. When using PlaySoundAndForget, it appears the sounds get put at the MasterAudio root and not the AudioListener. Is this the case? If so is there a reason for that?

    I know there is some code to get the entire MasterAudio hierarchy to follow the AudioListener, but that seems inefficient.

    Anyway, what is the correct usage of PlaySound and PlaySoundAndForget with regard to moving AudioListeners?

    Thanks!
     
  20. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    262
    Actually I'm looking at the code, and it looks like it creates the sound at 0,0,0. Probably assuming any sounds that get played that way have their AudioSource configured to play in that setup. So that probably answers my question but if you have any thoughts I'd be interested. Thanks.
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I think you may be talking about some long-since-gone code. Mostly only previewing cares about the Audio Listener position (it plays the clip on the Listener game object so it's max volume).

    And AmbientSound and Occlusion. Nothing else cares about the Listener position.

    Normally if you're doing 3D sound you will use the PlaySound3DAtTransoform (or FollowTransform) methods. The Audio Sources and clips live in the Master Audio game object but will set their position to the actor's position, and update continually once a frame if you do FollowTransform. This is not for the entire MA game object, just per Variation. If you hear glitches because your Audio Listener is on a gravity physics object, then you can tell the update to happen in FixedUpdate instead of LateUpdate. There's an option now.
     
  22. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    262
    Ok so if I want to play sound at AudioListener's position I should figure out the current AudioListener's transform and play it using the 3D methods on there?
     
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sure, or just make that sound 2D if you want to ensure the volume is always the same. Or assign it to a bus with "Force to 2D".

    MasterAudio class already has the Listener Transform as a property if you need it.

    Code (csharp):
    1.  
    2. MasterAudio.ListenerTrans
    3.  
     
  24. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    262
    Oh nice, I was just writing my own method to find it. Thanks.
     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No problem.
     
  26. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I am not here to cause any misunderstanding, but I recently came to use IntroLoop asset to loop my music from point to point. So this kind of looping is possible in Unity. It worked really well.

    What I was hoping was if MA can somehow try and do the same thing for looping. I know I asked this feature before...

    I want to use ducking system and really be sad and hate to use two different audio system for the game...

    Just hoping...
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It's on the roadmap, #10 and #11, http://darktonic.freeforums.net/thread/87/feature-roadmap-master-audio-suggest

    Things just keep getting in front of it. In fact, we may never get to it....but it's on the list. Do you know if that asset creates a new clip with the loopable part? That seems the only way to accurately do it. Otherwise you could only get as close as 1 frame's time.
     
  28. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I am not sure if it creates separate asset internally, but it doesn't look like so, because I can change the looping point during runtime and it seems to work fine. I have not noticed any audio hickups. Need to take deeper look, but it does work...
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Well I have no idea how that is possible. As I said, the only way Unity lets you code things is to affect any Unity API's during the next frame, not in between frames. You can run other code in other threads, but it can't really do anything with the Unity API so that doesn't seem to help. So it seems impossible without creating a new clip.

    If you have any ideas, I'm all ears.
     
  30. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
  32. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Excellent..!
     
    jerotas likes this.
  33. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    We're setting up Master Audio to manage our layered/adaptive music. One question: Is there a way to lock the music layer transitions to the measure, which would feel more natural musically? If not, we can calculate the length of the measure in each set of tracks -- any suggestions on how best to use that in MA to regulate the timing of the layer changes?
     
  34. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I have no idea how that would be possible aside from you doing the math, so no, I don't know. I would guess I'd need to know the beats per minute if we were to add a feature, but not sure it could be exact even if so...
     
  35. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Hi Brian

    I need to detect silence in advance in an audio clip, say 2, 3 or 5 seconds ahead, and make logic based on whether such silence exists.

    Do you have such a feature in MasterAudio?

    Thanks
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    How is it that you wouldn't know? Are you recording the clip within the app?

    The answer is no, we don't examine the data in the clip at all and there are no plans to do so.
     
  37. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    The logic is that the audio track drives the state of UI elements, and there will be multiple audio tracks. So there could be multiple silence gaps or not, and that's why I though about your asset.

    Currently I am using GetSpectrumData and it could work only if I could tell it to examine spectrum data from timeSamples + 44100 (samples) * I but GetSpectrumData or GetData only work on current section of track being played.

    Anyway, thanks for your reply.
     
  38. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yeah, that sounds right. Not sure how you look ahead further...you might want to ask on the Unity Audio forum.
     
  39. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    Is it possible to set something like "selection variation probability" ? I have multiple sound variations in a group and I want at some point in my game to prevent some variations to be selected. I cannot use the "weight/voice" property which is not really a probability but a way to duplicate a sound variation in order to play it multiple times. It won't allow me to completely set a sound variation chance to be selected to 0 or instead set another one to 1.

    Thanks
     
  40. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Use the Probability To Play field. Defaults to 100%. Each Variation has it. To change it at runtime though you'd have to set it for each clone (clones created by the Weight property) that match. I can give you code if you can't figure it out.
     
  41. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Good idea, thanks Brian
     
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No problem.
     
  43. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    I'm pretty sure this it not what I want. The Probability To Play field it's used after the sound variation has been selected. It will only decide if the sound will be actually played or if nothing is going to be played. What I want is the make sure a sound variation wont be selected at all when a sound variation is randomly picked up. Does that make sense ?

    Thanks
     
  44. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hello, I am having a bit of trouble with getting a group to play using the PlaySoundAndForget approach in my script. I am not at the office so please bear with me as I try to get my problem across.

    The game project is extremely basic with a square that automatically moves forward a step based on a DeltaTime value. Every time the square moves one step I want my sound group to play. I am using an InvokeTimer method for DeltaTime movement and within that method I am successfully getting an AudioClip to play every step if I use standard Unity audio scripting. However, if I use the PlaySoundAndForget code within this same method it only plays the sound something like once a second.

    I managed to solve this by moving the PlaySoundAndForget line of code into the actual square movement method. I thought that my problem was solved but upon testing the build the group stops playing after an unknown (as yet) amount of time.

    The other issue that I have to contend with is that ff the square hits another square somewhere the movement speed increases slightly. So over the duration of gameplay the group that I want to hear will end up playing faster and faster; so after a while it should start to sound like a drum roll.

    Can anyone point me in the right direction on this?

    EDIT: I think that I may have solved the issue so will see how it goes and come back here if I am still stuck.
     
    Last edited: Feb 14, 2018
  45. Yodzilla

    Yodzilla

    Joined:
    Mar 21, 2013
    Posts:
    48
    I'm on Unity 2017.2 and started getting an error when trying to add new audio groups. I updated to the newest version of Master Audio (and deleted all old files just in case) and I'm still getting this error:

    NullReferenceException: Object reference not set to an instance of an object
    MasterAudioInspector.<get_SelectedAudioSourceTemplate>m__A (UnityEngine.GameObject obj) (at Assets/Plugins/Editor/DarkTonic/MasterAudio/MasterAudioInspector.cs:5298)
    System.Collections.Generic.List`1[UnityEngine.GameObject].GetIndex (Int32 startIndex, Int32 count, System.Predicate`1 match) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:313)
    System.Collections.Generic.List`1[UnityEngine.GameObject].Find (System.Predicate`1 match) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:216)
    MasterAudioInspector.get_SelectedAudioSourceTemplate () (at Assets/Plugins/Editor/DarkTonic/MasterAudio/MasterAudioInspector.cs:5297)
    MasterAudioInspector.CreateSoundGroupFromTemplate (UnityEngine.AudioClip aClip, Int32 groupTemplateIndex) (at Assets/Plugins/Editor/DarkTonic/MasterAudio/MasterAudioInspector.cs:4347)
    MasterAudioInspector.OnInspectorGUI () (at Assets/Plugins/Editor/DarkTonic/MasterAudio/MasterAudioInspector.cs:1536)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1240)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)​

    The error is in method SelectedAudioSourceTemplate and I have Default Single picked in the editor. The specific line is:

    var selTemplate = MasterAudio.Instance.audioSourceTemplates.Find(delegate (GameObject obj) {
    return obj.name == MasterAudio.Instance.audioSourceTemplateName;
    });
    Any ideas on a fix? Thanks!
     
  46. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Hi. I was just wondering if cool, new way of music looping feature is coming any time soon? Where are we at the roadmap with this feature?
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No, don't understand what you mean. Sorry I didn't reply earlier, I got no notification of posts here...
     
  48. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, sorry I didn't respond earlier, I got no notification of posts here. Try the DarkTonic forum next time if you can as I check that every day.
     
    MudPuppet likes this.
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sounds like you might be missing your Audio Source Templates? Can you give me a screen shot of your Master Audio Inspector in the Sound Group Creation section up top?

    Sorry I didn't respond earlier but I got no notification of posts here.
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It's near the top of the roadmap. I did use this feature to add features for SFX in the update today (play / start part of a Sound Group Variation). And now Looped Chains and Linked Groups are seamless.