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
    As a workaround while you're waiting, you can not use weight and just duplicate the Variation yourself (CTRL+D) while in edit mode any number of times (to get to the target weight).
     
  2. ato

    ato

    Joined:
    Mar 14, 2013
    Posts:
    2
    Thank you for the quick reply !
    We have already think about that, but for testing purpose only. As working on a pretty big project, it won't be very convenient to duplicate all the songs. So we'll wait for a fixed version :).
    Thank you again and btw, great job with your asset !
     
  3. Vanulla Ace

    Vanulla Ace

    Joined:
    Jan 15, 2014
    Posts:
    1
    Are there any plans to build in some form of hierachy into the listing of the Sounds Banks in the Master Audio prefab?

    I am currently considering using Master Audio for my next project, but my last projekt had the equivalent of 200+ soundbanks. Without the possibility to operate with folders or some similar structure, the list of Sound Banks would become really unwieldy.

    Also - regarding the thing you mentioned about working on custom triggers for the Event Sounds. Great addition! This is one of the reasons I'm interested in using Master Audio.
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Indeed, understood. Thanks!

    No. You can sort by bus though and you can also filter by bus. If you have a lot of sounds, you will definitely be using buses, so that should give you the tools you need. We have about 70 Sound Groups in our 2nd game so far, and filter by bus is a life-saver. You can use buses as an organization tool, for changing the volume of X groups at once, or both!
    Custom triggers are done and released a few days ago :) - please read the Custom Events section in the readme PDF on how to use them (it's very simple).
     
    Last edited: Jan 16, 2014
  5. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    138
    The long holiday sale is over! We welcome our 1,200 new users! Never be shy to speak on the forum about any trouble you're having or things you'd like to see. Most of our newer features have come from customers.

    Master Audio is now $75. With the vast array of settings, features and functionality we provide with this plugin, we believe it is very much worth the asking price - no other audio plugin on the Asset Store has even one third of the options we have. And rest assured, there are still a lot of cool additions coming very soon!

    It's also still a great time to pick up our other plugin Killer Waves for the sale price of $30. Next week V3.0 will be coming out and the price will double.

    -DT
     
    Last edited: Jan 16, 2014
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V3.3.1.1 is submitted! We've finally upgraded Dynamic Sound Group Creator to be about as full-fledged and hierarchical as the Master Audio prefab. I put it off for awhile because I didn't want to break existing users' implementation. However I've made a button to upgrade your existing data so that doesn't happen! Changes are:

    • Breaking Change: If you don't want to start from scratch with your Dynamic SGCS by deleting them and recreating from Master Audio Manager window, switch to debug mode in the upper right of the Inspector, then drag the 2 "Dymamic" templates from Sources/Prefab into the debug mode of Dynamic Sound Group Creator prefabs you are using. While you're at it, drag the 4 new icons to their places.
      1. Delete Texture field = Sources/Textures/deleteIcon
      2. Settings Texture field = Sources/Textures/gearIcon
      3. Play Texture field = Sources/Textures/speakerIcon
      4. Stop Track Texture = Sources/Textures/stopIcon
      5. Group Template field = Sources/Prefabs/DynamicSoundGroup
      6. Variation Template field = Sources/Prefabs/DynamicGroupVariation.
      Then switch back to normal mode and you're good without losing your work.
    • Added full bus controls to Dynamic Sound Group Creator.
    • Added full 3-level hierarchy to Dynamic Sound Group Creator, just like the Master Audio prefab. Now you can specify filter FX per Variation.
    • Old configuration for Dynamic Sound Group Creator is no longer shown or used. However there is a "Upgrade Data" button to migrate it into the new format.
    • We also log a red error in the console if you attempt to run with "old data" Dynamic SGC telling you to click "Upgrade Data" to fix it.
    • Fixed Dynamic Sound Group Creator and Sound Group Variations so that custom rolloff curves work with the weight property. Previously this was broken.
    • Made all "previewing-only audio sources" lowest priority always.
     
  7. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Attention, I responded to a tech question from a user with the email: di@heroicstudios.de. My reply could not reach his mail inbox for some reason. If Dominik Isen reads this, please post your question in this forum or send me an IM here :)
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    V3.3.1.2 is the good one. It's live! Go ahead and grab it to get full-fledged per-scene audio now with the same look and feel as the main Master Audio prefab!
     
  9. jdyeager

    jdyeager

    Joined:
    Aug 18, 2008
    Posts:
    29
    Have you considered creating a PropertyDrawer for sound group names? That way you wouldn't need a custom inspector in things like ButtonClicker that allow you to pick what sound you want to play from the Inspector. We're still using a version of Master Audio that has enums specifically to avoid using string names everywhere now.

    This wouldn't help in PlayMaker since it's a completely different interface, but at least it would give an easy way to expose a sound group selector in the Inspector. Just a thought.
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'll take a look. I'm not sure that a PropertyDrawer would do everything I need it to do (and would it help eliminate string?) If you're still on an enum version of MA, you're missing probably 75% of total features of Master Audio, which were developed after enums were removed.

    There is a way you can get the indexes (integers) for all Sound Groups and save them somewhere when the Scene starts, then call PlaySound and PlaySound3d using the int's instead of strings - there are now alternate methods that takes int's. I have at least one customer doing that. Anyway I would strongly suggest you upgrade. The enums are not coming back due to numerous complaints we had on them.
     
  11. jdyeager

    jdyeager

    Joined:
    Aug 18, 2008
    Posts:
    29
    It wouldn't eliminate the string, but it would allow someone to just add an attribute to a public string variable to make it appear as a nice drop-down in the inspector. Otherwise you have to create a custom inspector for the class like you did for ButtonClicker. The PropertyDrawer drop-down would probably function a lot like that custom inspector I guess.

    For now the enum version is fine for our use. We just wanted some way to centralize audio management so we didn't have to dig through prefabs to change out audio clips. And some of the music fading/ducking is nice for background music. My main problem with the string names is just the brittleness when it comes to name changing. If the names are just strings, then we lose the benefit of not digging through prefabs to fix things when a name changes.

    Now that I think of it, I guess the PropertyDrawer won't help with that much either though. Even if it was smart enough to detect changes of sound group names and update whatever string it was managing correctly, you would still have to look at each object using the PropertyDrawer in the Inspector for it to be able to do that. Bleh... ah well. Like I said, just a thought. I think we're fine with the version we're using for now. And the PropertyDrawer might help people to not have to write custom inspectors, but it seems like that's about it. Thanks!
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You've hit on the things I loved about the enum, and the reasons why I originally hesitated to remove it. Alas, most customers did not want their sound designers having to muck around in a code file at all, so we had to go string. Even though people are now occasionally complaining about that now. But definitely less people.

    Now you realize that you could upgrade to the newest version, make your own enum with your SoundGroup names (for custom Inspectors on your scripts) and just do .ToString() on the enum when you call PlaySound methods, right?
     
  13. NickHVenden

    NickHVenden

    Joined:
    Aug 3, 2013
    Posts:
    33
    Greetings,
    I'm working on a Master's Thesis project at CSU Long Beach California. I recently purchased MasterAudio.
    The interface, the way you've implemented the AudioFilters/Pro, and the EventSounds scripts, are great.
    This will save tons of time coding. Thank you!

    However, the plugin generates an unacceptable amount of system noise in the Unity audio while I'm editing and building scenes. It's a complex noise that changes character with various key strokes. It shows up immediately when I load an instance into any heirarchy/scene.
    Can you help? I'd love to use MasterAudio but I may have to look into FMod or WWise.

    Thank you,
    Nick Venden
    Interactive Digital Media - Cole Conservatory CSU Long Beach, CA.
    MacPro 2x2.4 GHa Quad-core, 56 GB ram, Hammerfall audio interface
    I often have LogicPro,
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I don't think this noise has anything to do with the plugin, despite what you may be seeing. I have over 100 Sound Groups and I hear absolutely nothing on my expensive near-field monitors (even cranked up) - not unless I am previewing sounds or playing sounds.

    Also, I want to mention that we have well over 2,000 customers using Master Audio, including some in pretty high end studios, and no one has mentioned this issue before.

    If you think about it, it makes absolutely no sense that just having *anything* in a Scene would generate noise when not using it. I think you may have a grounding problem in your room or any number of other very-hard-to-pinpoint problems (live by a cellular tower maybe?). I have had many problems like this before in my music hobby, where I thought the problem was "something that made no sense", but it was always something else in the end.

    FMod and WWise are excellent solutions that have a lot more functionality that MasterAudio. They are also far more expensive and I believe the licensing is ongoing (you keep paying). I also don't believe they will solve your noise problem unless it's by some weird coincidence. Anyway, I wish you luck in figuring out the problem. I definitely cannot reproduce any part of it here...
     
    Last edited: Jan 18, 2014
  15. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Hi, I'm using v3.3 to create dynamic sound group on the fly in script, but it seems cannot find overload(from readme.pdf) for
    MasterAudio.CreateNewSoundGroup(string gourpName, AudioClip clip)
    Mono only gives me
    MasterAudio.CreateNewSoundGroup(DynamicSoundGroupInfo gInfo, string creatorObjectName)
    Am I doing it wrong? How to load wav file from device and let master audio play it in script?
    Thank you.

    ----------------------------------------------
    Edit: After read MA source code, I try this and it works. Is it the best practice btw?

    DynamicSoundGroupInfo info = new DynamicSoundGroupInfo ();
    DynamicSoundGroupVariation variation = new DynamicSoundGroupVariation ();
    variation.clip = testClip;
    info.groupName = testClip.name;
    info.variations.Add (variation);
    MasterAudio.CreateNewSoundGroup (info, this.name);
     
    Last edited: Jan 18, 2014
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The documentation is out of date, I must have missed this part. DynamicSoundGroupInfo is not used in the latest version (soon to be deprecated). I suggest you update to the absolute newest version - 3.3.1.2 - so you don't have to recode this part. You should be passing a DynamicSoundGroup object to CreateNewSoundGroup.

    The current method is:

    Code (csharp):
    1. MasterAudio.CreateNewSoundGroup (DynamicSoundGroup aGroup, string creatorObjectName);
    The documentation is now updated here:

    If you have a reference to the AudioClip on the user's device, then you will be able play that wav. We don't have code to get a reference to a device audio clip though. If you figure out how to do that, I'm sure a lot of users would like to know how.
     
    Last edited: Jan 18, 2014
  17. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Hi,
    https://dl.dropboxusercontent.com/u/40293802/DarkTonic/MA_ReadMe.pdf says V3.3yet the doc in the asset store says V3.1

    Which is correct? I'm trying to get up to speed on MA to see if I can use it for a project and just want the docs to be accurate.

    Q: Is there a way to feed MA a group of transforms (say on a spline or a group of sound source locations - say to represent an area in a forest) and have it be triggered by player proximity to closest points

    ty!
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The Dropbox one is always up to date. I haven't submitted a hotfix just for doc changes. I don't understand your second question, so please rephrase it. The answer is no about feeding Transforms, but maybe there's another way we can accomplish what you're trying to do. I have to understand what sound you want to produce in what way first though.
     
  19. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Please keep the doc in the package consistent with what is released. It doesn't make sense not to.

    re: Q
    I'm trying to set up some randomised environmental audio for a test forest environment. For example, a swamp scene with different birds/insects etc.
    So imagine an area of a certain size, as the player walks through it there might be some constant ambience like water or wind, and then randomised birds.insects from different 3D positions.
    I'm trying to imagine how best to do this using MA.
    So a central transform might contain looping water/winds, and arrayed around that in a circle or irregular path (might even be dynamic as objects move) are nodes that trigger different sounds.

    The MA doc is really just a technical doc, and I'm still trying to get my head around the MA main object and DynamicSoundGroups, trying to understand how they work and the event system works.

    for example: the above scenario needs 3D sounds triggered by collider or range of player but the first thing the doc says is "2) First, create the Master Audio prefab with the "Create" button. T
    prefab will be used for all triggered 2D sounds (if you have any),
    AudioListener in your scene if you have any 2D sounds planned."

    I tried creating a soundgroup with DynamicSoundGroupCreator but it does not seem to get picked up by EvenSounds.cs that I add to a test transform.

    Edit: Just reran that test with a variation group under the MA main controller and it picks them up, and a sphere collider triggers them ok.

    Q: How do you randomise pitch?

    Q: How you trigger events with a DynamicSoundGroup if the EventSounds does not pick the group up?

    ty!
     
    Last edited: Jan 19, 2014
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I do. I happened to have missed one detail in the doc is all, and this is the first time this has happened. Someone pointed out the discrepancy and I fixed the documentation (on Dropbox). I will submit a hotfix just for the doc change tonight so they are the same.
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    In my world, the "technical doc" is the API website here. The Readme is not just a technical doc. Please explain what else you think should be in there for it to be more useful, and I'll see if I can add some things :)

    There are 2 basic ways to use Master Audio.

    1) A separate MasterAudio prefab per Scene.
    2) Only 1 MasterAudio prefab, in your bootstrapper Scene, with "Persist Across Scenes" turned on. The main reason people will use this option is so you can have music that plays when the Scenes changes without the music getting cut off.

    If you're doing case #1, you will not use Dynamic Sound Group Creators most likely. They are only used for temporary per-Scene Sound Groups and also for Sound Groups where you're not sure which audio clips you will use before runtime (like if you wanted to change to a "skin" of different fire, jump, and run sounds based on user input selection for example. Prefabs with a Dynamic SGC could then be spawned to put these sounds into Master Audio at runtime.

    If you're doing case #2, you would set up any Sound Groups that you'll need in every Scene under Master Audio, then use Dynamic Sound Group Creator to set up the per-Scene sounds.

    Event Sounds' Sound Group dropdown will not show the name of any Sound Group that's configured in a Dynamic SGC. It will only show Sound Groups in the MasterAudio prefab, if there's one in the Scene. Normally if you're using a Dynamic SGC, there will not be a Master Audio prefab in the Scene, because it's in the bootstrapper Scene only. So you select "[Type In]" from the dropdown and paste the name of the Sound Group there to trigger it from Event Sounds.

    I'm not sure why I didn't make the EventSounds Sound Group dropdown not show Dynamic SGC groups. I could possibly make that work if there is interest in the feature?

    Randomizing pitch is done per Variation (each Sound Group is composed of 1 or more Variations). To get to the Variations for your Sound Group, click the gear icon on the mixer (this is the same on Dynamic SGC) for the Sound Group you want, then you will be looking at the Sound Group's Inspector, where it shows all Variations. You can set random pitch, random volume, custom fading, and lots of other settings here for the Variation.

    On EventSounds, if you choose "Caller Location" or "Attach to Caller" from the Sound Spawn Mode dropdown, they will not be played in 2D.

    This is all in the readme, so let me know if I should maybe rewrite certain parts if they were confusing?

    Let me know if you have any other questions!
     
    Last edited: Jan 19, 2014
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I had one customer awhile ago suggest that we add a non-game example scene to Master Audio. Does anyone else think that would be useful? If so, what should the example scene have in it or show off?
     
  23. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Great! Apologies if I sounded a little shirty, I didn't know that and I'm trying to integrate a number of things atm and wasn't sure how far they diverged.

    ty!
     
  24. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Great, thanks for the explanation/clarifications.
    Technical docs to me encompass both API and explanations of functionality + examples.

    I just think you need some more example scenes that illustrate the range of scenarios that MA is capable of.
    A 2D shmup is not the same as a 3D environmental based game/app that can have a whole range of interactive audio situations that need to be triggered.
    I think you also need an example that shows the MA/DynamicSoundGroup in action.

    They don't need to be complex, and can be done with simple prototype blocks (Unity has a bunch in their new Sample Asset packs, for example)

    ty!
     
  25. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Is it possible to get more randomization between clips in the looped chain variation mode, in terms of time so they don't just play directly one after another but after some randomized delay?

    Either a "LoopedChain with variable delay" or another random delay setting per clip, set to an upper time limit in secs that it will choose from before playing that clip in the loop.

    Also, it would be great to have the option to also pitch shift in semi tones.
     
    Last edited: Jan 19, 2014
  26. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    It looks like Unity 4.3 has made some change to the Inspector code as the Inspector for MA now needs to be really wide in order to display properly.
    I've confirmed this with another package, but have noticed the same behavior with MA.

    Can you confirm the same issue?
     
  27. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Sure. It works on desktop but I'm not sure if it's the best practice or maybe some path issues on other platforms. So test it careful. :)

    Code (csharp):
    1. public IEnumerator GetAudioFromFile (string filePath)
    2.     {
    3.         filePath = "file://" + Application.persistentDataPath + filePath;
    4.         filePath = filePath.Replace (" ", "%20");      
    5.         WWW www = new WWW (filePath);
    6.         while (!www.isDone) {
    7.             yield return null;
    8.         }
    9.         if (www.error == null) {
    10.             while (!www.audioClip.isReadyToPlay) {
    11.                 yield return null;
    12.             }
    13.             MyGlobal.WWWClip = www.audioClip; //This a static AudioClip in a static class so we can pass it out
    14.         }
    15.     }
    Then we can get audioClip from device like below.
    Code (csharp):
    1. yield return StartCoroutine (oh.GetAudioFromFile (audioPathOnDevice)); //oh is my helper class
    2. AudioClip hereItIs = MyGlobal.WWWClip;
    3.  
    Save AudioClip to device is another challenge, I can save it as wav file so far.
    The code is a bit longer, if anyone interested in that, I'd like to share.
    But as I said, it's way bigger than a reasonable size, if anyone have any idea about how to save it as mp3 file or compress it, please let me know.:)
     
    Last edited: Jan 19, 2014
  28. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    I just upgraded and saw the brand new DynamicGroupVariation.
    Weird thing is I can see there's a "audio clip" in inspector but no such a property in script.
    How can I pass my audio clip to DGV?
    Here's where I stuck.
    Code (csharp):
    1.  
    2. DynamicSoundGroup group =new DynamicSoundGroup();
    3.         DynamicGroupVariation variation = new DynamicGroupVariation();
    4.         variation.audLocation = MasterAudio.AudioLocation.Clip;
    5.         //I guess audio clip should be pass like what it is in DynamicSoundGroupVariation
    6.                 //variation.clip = myAudioClip;
    7.         group.groupVariations.Add(variation);
    8.         MasterAudio.CreateNewSoundGroup (group,name);
    9.  
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There is a Dynamic SGC in the example scene to show dynamic sound usage. I would love to set up a bootstrapper scene and all that to show the proper usage of that, however it's not possible without the user doing manual steps after importing because the Scenes don't get moved to your "Scenes in build" settings.

    I'll see if we can do a 3d example.
     
  30. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'll look into doing both of these.

    It looks slightly wider on Unity 4.3, yes. I dont' think anything can be done to rectify that. The indent levels are set to zero, which is the minimum. On Unity 4, indent level zero is further to the right.
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Since there was an AudioSource in each Variation in a Dynamic SGC, I was using the AudioSource to source the volume, pitch, audio clip etc. However, you can't really add an AudioSource to a script. So it looks like currently, you'd have to Instantiate the DynamicGroupVariation prefab and use that, then destroy it if you want to do it at runtime. If may be easier to just have a prefab which has the Dynamic SGC attached, and modify that by script, then spawn it to create the Groups.
     
  32. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    654
    Hi,
    I've been preparing to integrate the excellent-sounding Master Audio but have some concerns re. theoretical performance. I say theoretical because I'm (a) aware of Knuth's "premature optimization is the route of all evil" but am (b) yet another Indie so can't profile!
    I'm targeting mobile so want to run lean and minimize GC. I've seen the forum posts on strings vs. enums vs. ints howver I'm more worried by some other oddities that, at first glance, could be slightly tweaked to reduce overhead. Some initial biggies including some suggestions to make MA even better:

    1. MasterAudio.CoStart() creates a new coroutine every .1s! What's the reason for not (a) making CoUpdate() into a looping coroutine or (b) (per http://answers.unity3d.com/questions/189917/any-costs-i-should-know-about-associated-with-invo.html ) making Start() simply use InvokeRepeating() on a (renamed) CoUpdate() ?

    2. LogIfLoggingEnabled() seems rather heavy even when not enabled! (call GrabGroup() before testing whether logging globally enabled). Minimally, move the global test above GrabGroup() (which includes a SortedList lookup). Better, make logging cause no method-call if possible, e.g. tell users to ensure DEBUG is defined if wish logging outside Unity Editor (done when Debug Build enabled IIUC) then tweak the declaration to:

    #if !DEBUG
    [System.Diagnostics.Conditional("UNITY_EDITOR")]
    #endif
    private static void LogIfLoggingEnabled(string message, string soundGroupName) { ... }

    3. Every code-based play call creates (usually) 2 new PlaySoundResult which are usually not used. (It's created at the top of both PlaySoundAtVolume() and PlaySoundIfAvailable() (and the prior calls the latter)!? It would seem neater to only create when needed (return new PlaySoundResult; or better, null means problem -- which all of these cases are!). For myself, every shot (of which there are a lot) triggers a sound and after that, I don't care so don't use the PSR. Anyway to avoid at all?

    I could go on (e.g. PerformBusFades() gets a reference to a Bus by name then passes its name to SetBusVolumeByName() which looks-up the Bus by name again?!). I saw your assurance above that you've used in mobile and not had issues (videos of Wall Street Titan look great :) ) ... but I'm still kind'a ... twitchy(?) about integrating MA when a cursory glance shows these sorts of curios. If you don't have time/inclination, would you accept patches to tweak some of these? I really like the system at an overall level (enough to hand over cash for it! -- a high barrier for a penny-pinching indie like myself!) but I hate to maintain diffs for my own branches of things and hope these tweaks would make MA even better and benefit all of your customers.

    Thanks for listening!
    Rupert.

    p.s. From sub-thread with @sonicviz, I'd +1 for examples using MA in multi-scene setup for cross-scene music from bootstrap scene and configuring effects per-level / config. That was to be my next question!
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Of course I would accept patches from users (as long as they're from the newest version), or fix these myself (they will be one way or another). #1 is particularly odd to me because I took that from a Wiki on how best to do a sub-thread, but obviously it's not ideal now that I understand more of how these things work. And I hadn't looked at that code in a long long time.

    P.S., I don't like the conditional #Debug part above. I don't think most non coder users would user that. And we have thousands of users like that. I'd probably fix that the first way.

    As I mentioned above, if I do a multi-Scene setup, the user will have to manually go into Build Settings and set up a couple of the example scenes to go in order or it won't work. I wasn't keen to do it for that reason alone. Thoughts?
     
    Last edited: Jan 19, 2014
  34. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Arkade, I submitted an update (V3.3.3) which addresses all 4 of the optimizations you pointed out. As a result of #3, it is now necessary for users who use PlaySoundResult to first check if it's null before accessing its properties. Like this:

    Code (csharp):
    1.  
    2. var result = MasterAudio.PlaySound("Laser");
    3. if (result != null  result.SoundPlayed) {  // note: if you played the sound with a delay, use  result.SoundScheduled
    4.      result.ActingVariation.SoundFinished += YourMethodToCall;
    5. }
    6.  
    It's now live.
     
    Last edited: Jan 19, 2014
  35. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    654
    Doh! I just finished dinner, made the changes, generated patch files, refreshed the forum page and you beat me to it!!! ;-) I'll look forward to seeing how my changes compare with yours.


    Re. 2, are you sure I can't convince you to use the #if+Conditional proposed previously? I'd say it's pretty straight-forward for non-techies -- the message is "In Editor Debug builds have logging if you hit any of the MA logging tick boxes, otherwise there's none!".
    If not, while making my change, I noticed I was slightly incorrect -- it's an OR. My comment made sense if it was a global that enables logging. I imagine that's what you've added?
    However, the absence of the conditional means all string concats and ToString()s for logging are done regardless of whether the message will be displayed. Would you consider a varargs logging statement to remove these? (and come on, who doesn't prefer a nice varargs logging statement, eh? :) )
    Separately and more seriously, I noticed it's Debug.LogError() (which causes UnityEditor to pause). Is that intended?


    Re. 3, regarding the null test, I'll look forward to seeing your code however I infer from the absence of some extra flag (to indicate the caller doesn't need the PlaySoundResult) that null means failure. This means the common-case of success still supplies an unwanted instance. Perhaps you've found some better way. Like I said, I'll look forward to the change and get on with my integration! :)


    It seems a choice between no example of that or an example that requires the one of the customer's developers follow a couple of relatively simple steps (that they'll have done something similar to previously or later if they're going to publish!) If you're really worried, I'd moot the sample scenes that require the change show a BIG INSTRUCTION when opened and refuse to operate if run. You could even include a test in MA to ensure they're the only scenes (to protect against people leaving them in the production builds). It's either that or another of your awesome videos. I'm good with either :)


    Thanks for listening and being so receptive. I can only hope I take less-than-positive feedback as well as you did/do!
    Rupert.


    p.s. DAMNIT! Would you stop adding forum posts and updates every time I go back to the browser to submit my message!?! You're too flippin' fast! That's it, I'm not pressing reload again. Argh! ;-)
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The intention is to show a red error message in the Console. There must some kind of setting that makes the editor pause, because mine does not - and it never has in 2 years of using Unity. I'm fine with making the editor pause for any errors that are shown in red, because they require attention.

    Maybe the #debug part is a good addition. If you want to make that patch change and hand it over, and let me know how to test it, I'll put it in.

    Now null means failure to play or schedule yes. It's unwanted by you, but lots of people use that PlaySoundResult for various things. I'm loathe to add a 9th parameter to the PlaySound methods on principal because 7 is already too many...have a suggestion there?

    I'll put a couple example scenes in for this. I think tons of people for whatever reason never actually watch the videos, which is weird because they are extremely short, to the point, and helpful. Judging by number of times watched vs number of purchases.
     
  37. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    654
    What?! No update since I last read? ;-)

    In the "Console" Window, the furthest right toggle button is labeled "Error Pause". I guess yours has never been set!

    Yeah, IKWYM re. 7 parameters. Uncle Bob's "Clean Code" wriggles in embarrasment on my bookshelf every time I consider adding any more than 3 arguments (depressingly often!). Argument objects just don't feel fast enough here... well unless you could re-use them in consequent calls? Multiple method names seems the neatest but mandates all calling basically the same code under then cover (unless you feel a refactoring spree coming on?). Adhering to the "no flag args" advice means 4 methods, that would be something like:
    - PSR PlaySound3DStationary()
    - void PlaySoundStationaryAndForget()
    - PSR PlaySoundAttached()
    - void PlaySoundAttachedAndForget()

    I feel like I'm missing something from tiredness. Maybe the answer will come in the morning (hopefully not in the middle of the night in one of those annoying repetetive dream-fixes!)

    Ya, that is odd. I've watched one of them at least twice. Maybe it's the visual vs. word-based thinkers out there? More aural audience prefers (the written) words? :)

    Great! I'll hold off investigating for that then :)

    View attachment $MasterAudio-02-LogIfLoggingEnabled-v01.patch.txt is the patch (albeit with the LogError() tweak -- please switch it to LogWarning()/back as you prefer). To test, it's manual steps, I'm afraid:
    1. Enable logging and make sure you see some in the Editor.
    2. Do a "Development build" and make sure you see same logs in whichever platform's logging system (e.g. Android's adb logcat).
    3. Do a non-"Development build" and make sure you see no logs.

    HTH! Night, Rupert.

    p.s. It's funny, am I the only developer who's pondered the possibility of "programming library analytics"? A nice heatmap of one's libraries would be awfully handy for maintanence!
     
  38. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio is now on sale for 1/3 off ($50). Good time to pick it up!
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yep, I never set that in the console window :) I may in the future.

    I'll check out adding some more convenience methods and the parameter flag to omit making a PlaySoundResult in the next version or so. That's some of the most complex code in the package so it's not a task where I take refactoring lightly.

    Heatmap is awesome :)
     
  40. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    hi jerotas thanks for the release

    re: 1/3 off sale

    wow that is great, but i've already bought it what do i get :razz:
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You probably bought it even cheaper than that on a different sale :) I'm not worried.
     
  42. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    yeap and thanks for the many sales to choose from! :)
     
  43. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Finally, I make it.:)
    Put it here to save others time

    Code (csharp):
    1.     /// <summary>
    2.     /// Add a AudioClip to MasterAudio and return transform of the sound group incase you want to destroy it.
    3.     /// </summary>
    4.     /// <returns>The dynamic sound group transform</returns>
    5.     /// <param name="DSGC">Dynamic Sound Group Creator INSTANCE in your scene, NOT prefab</param>
    6.     /// <param name="prefabDSG">PREFAB of DynamicSoundGroup, you can find it at/DarkTonic/MasterAudio/Sources/Prefabs/</param>
    7.     /// <param name="prefabDGV">PREFAB of DynamicGroupVariation, you can find it at /DarkTonic/MasterAudio/Sources/Prefabs/</param>
    8.     /// <param name="name">Group/Variation name you want.</param>
    9.     /// <param name="clip">AudioClip you want to pass in</param>
    10.     /// <param name="clipVolume">variation volume</param>
    11.     /// <param name="clipPitch">variation pitch.</param>
    12.     public Transform AddDynamicSoundGroup (GameObject DSGC, GameObject prefabDSG, GameObject prefabDGV, string name, AudioClip clip, float clipVolume=1f, float clipPitch=1f)
    13.     {
    14.         if (MasterAudio.GetSoundGroupIndex(name)!=-1)  return null; // if exists then stop
    15.  
    16.         GameObject goGroup =  NGUITools.AddChild(DSGC,prefabDSG);
    17.         DynamicSoundGroup group = goGroup.GetComponent<DynamicSoundGroup>();
    18.         group.name=name;
    19.         GameObject goVariation = NGUITools.AddChild(goGroup,prefabDGV);
    20.         DynamicGroupVariation variation = goVariation.GetComponent<DynamicGroupVariation>();
    21.         variation.audio.clip = clip;
    22.         variation.audio.name=name;
    23.         variation.audio.volume= clipVolume;;
    24.         variation.audio.pitch=clipPitch;
    25.         variation.name=name;       
    26.         group.groupVariations.Add(variation);  
    27. }  
    28.        
    Ya, maybe I do it in a hard way, please feel free to modify it, and let me know the better way :)
    If you're not using NGUI, please change NGUITools.AddChild(father,prefab) to Unity instantiate function.
    What's more, you may need a list to manage transform it returns, so you can destroy them manually before load another level.
     
    Last edited: Jan 20, 2014
  44. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Wow, awesome that you got it to work! I believe you'll have to turn off "auto-create items" in the Dynamic SGC in your Scene so that you can guarantee this code happens before the items get created, and then you'll need to manually call the PopulateGroupData method followed by CreateItems. As long as you have "Auto-remove items" checked, all items will be automatically removed and all children destroyed automatically. Nothing to clean up. Great job!

    I should mention that if you know how many Sound Groups and Variations you'll be dynamically changing clips on at runtime, you can create "holder groups" in the Dynamic SGC and just use the script to change the names of the Groups and populate the audio clips at runtime. That way there wouldn't be any Instantiating going on.
     
    Last edited: Jan 20, 2014
  45. jdyeager

    jdyeager

    Joined:
    Aug 18, 2008
    Posts:
    29
    Hm, yeah that would probably be better than not upgrading. I'll look into it if I get some time to mess with audio again. Thanks.
     
  46. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Hi... in response to the 3rd post on page 28 of this thread:

    I was able to implement it using your first suggested method, thanks.

    I've been using Master Audio in depth now, and am quite pleased with all the features. I have a some questions/suggestions:

    1) Is it possible to loop a playlist containing only one clip with crossfades? If "loop" is selected, it doesn't crossfade. I was able to get around this by dragging the same clip to the playlist so that there are 2 identical clips in the playlist. This crossfaded and looped the clips, but I was wondering if there is any memory usage increase by doing so versus having a selectable option for it?

    2) Is it possible to set per-playlist crossfade times instead of a global setting?

    3) When using the Playmaker Play Sound action with a delay, is it possible to cancel the playing of the delayed sound during the delay time before the sound starts? "Stop All Of Sound" only stops the sound after the sound starts, but doesn't prevent the delayed sound from playing if it is used during the delay period. I was able to get around this by creating another fsm and using "wait" before I played the sound (and having a cancel event), but was wondering if there could be an action to cancel the invoke somehow.

    4) In "Use Custom Fading" settings in sound groups and in "Cross-fade Time" in the Master Audio prefab , Would it be possible to add different types of fades such as Linear, Equal Power, Log, Cosine, etc. with perhaps a little graphic of the fade type?

    5) Even with audio buffering set to "Best Latency", I still get a little bit of latency with the "Event Sounds" script and with Playmaker. The audio clips are edited so that the start times are right at the sound start too. Are there any other tips or tricks I could try to minimize latency even more? This is on standalone.

    Just wanted to thank you again for a wonderful comprehensive product and support. I'll be giving Master Audio 5-stars.
     
  47. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Not to butt in, but I'd like to get some more info on what exactly "best latency" and "best performance" do.
    I have to use "best performance" on iOS otherwise my pitch recognition starts to drift with increased latency which has led me to believe "best latency" does exactly that...gives you the best latency possible not the lowest!
     
  48. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Where are you guys seeing this latency setting? I haven't seen it.
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you Korindian. I guess I never wanted to crossfade the same clip into itself. There should be no memory increase doing it how you did (with 2 of the same) since it's the same clip. I must point out that cross-fading occurs when changing songs (or clips), which does not technically happen when you're looping the same clip.

    Let's make sure, would you want it at a per-Playlist level or a per-Playlist Controller level? We should be able to do that without a problem once you clarify.

    Edit: Fixed and live! StopAllOfSound now cancels scheduled sounds.

    I'm afraid I don't know the math of how to do that. If someone points me to something I will take a look.

    Hmm, how are you measuring or hearing latency? Are you using Resource files? Is that when you export only? I've never heard any latency myself except on large Resource files, which is expected.
     
    Last edited: Jan 22, 2014
  50. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    It's in unity audio settings