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's one of the bug differences between DarkTonic and other plugin authors. The service! As was said about us in another thread: "That was faster than premium services at large corporations!"

    If you have any more questions, feel free to ask. And if you haven't read the main sections of the manual, you should :) I know it's long (~30 pages), but it is full of cool stuff you will want to know later.
     
    Last edited: Feb 3, 2014
  2. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Ugh, I hate to have to ask questions like this but I can't find the answer and I'm reluctant to delete anything...

    ...but I just updated to 3.3.9, and imported it without deleting any of the old folders. On my Master Audio GO and it still says 2.7.

    Should I have done something to prep the update or should this just work?

    Thanks Jerotas!

    -Steven
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    So before today you were on V2.7 right? You will need to do the "breaking change" steps that are listed in the release notes section in the 2nd post in this thread for the following versions: 3.1, 3.1.2 3.3.1. Here they are for your convenience. If it's easier for you to just nuke everything (if it's easy to recreate), you can opt to do that. Most likely, it's #2 below that's causing what you see.

    1) Breaking Change - please delete VariationInfo.cs. It is no longer in the package and may cause compilation errors.
    2) Breaking change: (not really, but need to pay attention). Added a container folder "DarkTonic" for the top-level Master Audio folder. This way we're able to avoid duplicate class errors from UndoHelper if you use more than one of our products. When upgrading to this version, please delete the Master Audio folder first or create a "DarkTonic" folder in Assets and move the Master Audio folder into it before upgrading.
    3) 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.
    Delete Texture field = Sources/Textures/deleteIcon
    Settings Texture field = Sources/Textures/gearIcon
    Play Texture field = Sources/Textures/speakerIcon
    Stop Track Texture = Sources/Textures/stopIcon
    Group Template field = Sources/Prefabs/DynamicSoundGroup
    Variation Template field = Sources/Prefabs/DynamicGroupVariation.

    If you do all these steps, then re-upgrade and still don't see a v3.x logo, there may be an Asset Store problem right now.
    Let me know!
     
  4. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    ...I opted to do just that! Haha, yea it was cheaper to just 'buy new xmas lights' than to untangle the old ones.

    Everything is back up and working with the new version, so win-win!

    Thanks for the speedy reply Jerotas

    -Steven
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Awesome, and sorry about the breaking changes. I make them only when it's totally necessary. Normally we get around those things!
     
  6. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Oh you know it's all good. I needed a refresher on using MA, plus a bit of breaking is worth new features.

    I have to say, you guys are the hallmark of support, and I wished all asset developers behaved the way you guys do.

    Thanks again Jerotas!

    -Steven
     
  7. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Don't mention it! That's why we are here.
     
    Last edited: Feb 5, 2014
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio v3.4 should be live in about 15 minutes. Changes:

    • Added a random delay min and max fields to each Variation. If you use these, an additional random delay will be used before the sound is heard. I say additional because this is on top of any random chained loop delays or delay times you pass into PlaySound methods or specify with EventSounds.
    • Added Bootstrapper Scene / Game Scene to the example scenes folder. This shows you how to set up per-scene sounds and music that can play across scenes!

    Sorry for the long delay on getting that last item done. Now we have it!
     
  9. NickHVenden

    NickHVenden

    Joined:
    Aug 3, 2013
    Posts:
    33
    Congratulation on a great audio tool.
    The synkro works flawlessly. Nice compact, intuitive interface.

    I can get everything in the EventSounds script to work except Collision and 2D collision. I tried every combination of things i.e. rigid body, putting script on the different object etc. What's the secret there? I'm using v3.1
    Nick Venden
     
  10. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    -DELETED- Ah, don't mind, there is "PlaySoundAndForget"
     
    Last edited: Feb 6, 2014
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Collision required both objects to have a rigidbody. One rigidbody must be "gravity". Both need colliders with trigger turned off. 2d collision is the same but use 2d rigidbodies and 2d colliders.

    In both cases all these components must be on the same game object as the EventSounds script. Not a child or parent.
     
  12. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Is there way to stop all sound of a certain bus from code?

    Also, right now I have this scenario.

    12 playble character; each one has same voiceofer sfx, like "talk1", "talk2" e.t.c
    What is the best way to arrange them inside Master Audio?

    Ideally, I wanted to have somethink like:
    Character1 Group
    -->Talk1
    -->Talk2
    ...
    Character2 Group
    -->Talk1
    -->Talk2

    and e.t.c.

    Currenly, I need to make it like that using groups:
    Talk1_Character1
    Talk2_Character1
    Talk1_Character2
    Talk2_Character2

    and filter by bus "Voiceover", because I can not have same group with the same name.
    What's the most clearest way to set up those voice overs? Or there is no easier way of what am I using now? I'm planning to trigger those sounds directly from the code.
     
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yeah, you can call MasterAudio.StopBus(busName), as listed in the API doc here

    You can arrange the sounds how you have (one Group for each character), or if there is not too many, you could put them all in one Sound Group and play the specific Variations by name.
     
  14. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Thank you, likely going 'variations' way sounds the best
     
  15. Parallel_

    Parallel_

    Joined:
    Dec 9, 2012
    Posts:
    90
    How do I make sounds only 2d? I have the audio listener (and childed master audio script) positioned on a fixed ortho GUI cam, yet when I zoom in on the character on the perspective camera the sound volume both goes up as if coming closer and distorts (I guess from the workload of zooming on a poly heavy character on a kindle fire), this tells me that the sounds may be set to 3d. Do I need the event sound script on the master audio object? and which setting to only have 2d sound?
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Normally you just select the audio clip in Project View, and turn "3d sound" off up top in the Inspector. That makes that particular clip 2d. Then, when you want to play the sound, use EventSounds with "Master Audio location" selected instead of Caller Location or Attach to Caller. From code (if you need to write code), use MasterAudio.PlaySound - not the PlaySound3d methods.

    Also, if you are saying that the Master Audio prefab is a child of another prefab, please fix that - it's not a supported scenario. Master Audio should be a top-level prefab and not a child of anything.
     
  17. Parallel_

    Parallel_

    Joined:
    Dec 9, 2012
    Posts:
    90
    Thanks Jerotas, that fixed both problems (distortion and 3d).
     
    Last edited: Feb 7, 2014
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Good to hear!
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V3.4.1 will be live in 15 minutes. Changes:

    • Added controls to specify number of loops for chained loop Groups instead of only endlessly looping.
     
  20. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Is there a way to get audio clip length of some particular group from the script?
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Not until you play it. Explain why that would be useful?
     
  22. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    I need it to synchronize with lypsinch animation. No worries, thought, I'll find a workaround then.
     
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Not much trouble. I will add this in the next version. You will need to specify a variation name and group name, it will return the clip length.
     
  24. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hi, @jerotas
    I'm back on audio work -- sorry about my hiatus! First, two delayed responses then a question about multi-scene MA.

    1. Sorry my patch messed-up the variation selection stuff (also to @jeffc42)! Ode to unit tests, huh! doh! :-D

    2. Re. my singleton need, I reverted my reference counting stuff (which I'd added to MA) and switched to PoolManager-based approach as you suggested. This did mean I have to leave all DSGC stuff in-scene once added but, per your previous recommendation, I'm assuming this isn't gonna kill memory/CPU when unused. (For the curious, I created a PoolManagerUtils.ensureSingletonExistsInSceneSingletonPool() that creates an extra PoolManager SpawnPool with singleton behaviour if none available (since obviously, don't want to have to make and configure one of these for each object type for each scene!).) Can make available if useful.

    So, current MA question...
    When using single splash-screen-based MA with DontDestroyOnLoad set, how does one *conveniently* test audio of individual scenes?

    Approaches...
    Obviously, there isn't a MA in each scene (it's in Splash). I don't want to create a temporary one with the editor every time I want to test a scene (obviously this is a multiple times per XXX affair during development!) So need to make it with code.

    The 'obvious' solution that occurred to me (first approach) was to have my audio function (which wraps MA calls for abstraction) include a check MA.SoundsReady and create a new MA if absent. Done. DSGCs all failed their Start() methods? Have the new code manually find and call all of my DSGC.CreateItems(). Need buses? Create 'em. Hitch, MA requires some things to have been setup by the MasterAudioInspector (first is soundGroupTemplate -- null in my runtime-instantiated version -- imagine there'll be more).

    So, seems I need to use a prefab if I'm going to dynamically add it. AFAIK that mandates a MonoBehaviour (to store the prefab reference to Instantiate()), right?

    So 'obvious' solution to this (second approach) is have this MonoBehaviour -- MasterAudioDevTimeGuarantor -- in every scene and have it check whether we're developing (i.e. running in Unity Editor), check for MA presence and Instantiate(prefabMA) which we prepared earlier.

    Aaaaand, now I feel like I'm down a rabbit hole and probably missed a blue pill opportunity back there somewhere? What'd I miss? :)

    TIA, Rupert.
     
  25. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Ok, so the second approach works (even with music ducking once I'd Instantiate()'d the PlaylistController before the MasterAudio).
    Guess I'll leave that as is unless there's a better solution (perhaps one that doesn't require remembering to update the prefabs any time I make changes).
    R.
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    All the references to soundGroupTemplate - and yes there are *many* more - will be there if you use the code that's in Master Audio Manager to Instantiate :). It's not just the script you need, but the prefab. However, you will definitely lose any settings on the Master Audio prefab that are in your splash screen when testing that way even if it *works*.

    Maybe if you do it in Awake in the Dynamic SGC it will work? Not sure.
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V 3.4.1.1 will be live in about 10 minutes. Changes:

    • Added a method to get the length in seconds of a Variation, taking pitch into account. MasterAudio.GetVariationLength(string soundGroupName, string variationName);
    • Fixed compile error from missing AudioUpdater.cs file.
     
  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I added this and it will be live in about 10 minutes. Check the previous post for how to call it. Note that it does not work with Resouce file clips for obvious reasons.
     
  29. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,529
    This is a really great plugin. The functions for controlling pitch, variety, groups, volume and everything in such a clear front-end is fantastic. I can even drop the sfx arrangement as a prefab to use between scenes. Playmaker actions too?

    Couldn't get much simpler.

    Really excellent product.
     
  30. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you LaneFox, we've put quite a bit of thought into the UI, and it's great to hear that was worth the effort. Can we quote you on this for our upcoming promo materials?
     
  31. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,529
    Absolutely, you earned such praise.
     
  32. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Awesome, thank you very much! Do let us know if there's any features you'd like to see added or any questions you have.
     
  33. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Yai, thanks a lot! Works like a charm now.
     
  34. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No problem!
     
  35. Jimww

    Jimww

    Joined:
    May 14, 2013
    Posts:
    63
    Hi, I just want to have a specified playlist play through once and stop. I see "Auto advance clips", but that also loops all the clips. Is the only way to have it play through a playlist once and stop, accomplished by subscribing to SongChanged and figuring out on my own if it's at the end of the playlist? Maybe I missed something obvious.?

    Thanks
    Jim
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'm not going to make you write code for that. This evening I will check if there's a way to configure this. If there is not, I should be able to put out a new version with it tonight.
     
  37. Jimww

    Jimww

    Joined:
    May 14, 2013
    Posts:
    63
    YAY!
     
  38. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I thought this would be a simple change, actually it's a bit tricky. It might take me another day or two to make the playlist stop properly and not when the cross-fading would normally kick in. Actually I'm hoping to make the last song cross-fade out to silence.
     
    Last edited: Feb 11, 2014
  39. zingaing39

    zingaing39

    Joined:
    Feb 11, 2014
    Posts:
    2
    Hi, i'm using masteraudio now, i want to play 1 sound several times, but when i do a test, masteraudio only allow 1 sound play, and if i want to play again while this sound is playing, i have to wait until this sound finish play, here my code:

    void Update () {
    if (Input.GetMouseButtonDown(0)) {
    MasterAudio.PlaySoundAndForget ("test", 1, null, 0, "King");
    }
    }
     
  40. Steamroller

    Steamroller

    Joined:
    Jan 2, 2013
    Posts:
    71
    Quick question.

    I have three audio tracks that i would like to play in sync with each other and fade between them based on what is happening in-game. Is this something that i can achieve via Master Audio's playlist or should I go ahead and code something up to deal with this pretty specific uses-case?

    Figured I'd ask before assuming it can't be done.
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Your code is fine. To set the maximum number of voices that can play at the same time, change the "weight" property in the Inspector of your Variation(s) for that Sound Group.

    You should watch the video in the OP, it shows me doing this and explains why.
     
    Last edited: Feb 11, 2014
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Are you wanting only one to play at a time? If so, use the "synchronize clips" Song Transition Mode on your playlist, and it will just work.

    If you want to layer the tracks, same answer, but create multiple Playlists and multiple Playlist Controllers. Watch the 2nd video in the OP which shows setup for Synkro.

    Asking before assuming it can't be done is a good idea here, especially because very often I go ahead and add a feature if it's not there :)
     
  43. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I noticed other people were asking about this in the thread, so I figured I'd share my code. Here is how you can make a component have a dropdown of all the MasterAudio Sound Groups in the editor instead of having to type the string. (jerotas feel free to include this in MasterAudio if you want ;) )

    Add SoundGroupAttribute.cs to a regular folder:
    Code (csharp):
    1.  
    2. using UnityEngine;
    3.  
    4. public class SoundGroupAttribute : PropertyAttribute { }
    5.  
    Add SoundGroupPropertyDrawer to an "Editor" folder:
    Code (csharp):
    1.  
    2. using UnityEditor;
    3. using UnityEngine;
    4. using System.Collections;
    5. using System.Collections.Generic;
    6. using System.Linq;
    7.  
    8. [CustomPropertyDrawer(typeof(SoundGroupAttribute))]
    9. public class SoundGroupPropertyDrawer : PropertyDrawer
    10. {
    11.     public int index;
    12.     public bool typeIn;
    13.  
    14.     public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
    15.     {
    16.         if (!typeIn)
    17.             return base.GetPropertyHeight(property, label);
    18.         else
    19.             return base.GetPropertyHeight(property, label) + 16;
    20.     }
    21.  
    22.     public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    23.     {
    24.         index = MasterAudio.Instance.GroupNames.IndexOf(property.stringValue);
    25.  
    26.         if (typeIn || index == -1)
    27.         {
    28.             index = 0;
    29.             typeIn = true;
    30.             position.height -= 16;
    31.         }
    32.        
    33.         index = EditorGUI.Popup(position, label.text, index, MasterAudio.Instance.GroupNames.ToArray());
    34.         var groupName = MasterAudio.Instance.GroupNames[index];
    35.         switch (groupName)
    36.         {
    37.             case "[Type In]":
    38.                 typeIn = true;
    39.                 position.yMin += 16;
    40.                 position.height += 16;
    41.                 EditorGUI.BeginChangeCheck();
    42.                 property.stringValue = EditorGUI.TextField(position, label.text, property.stringValue);
    43.                 EditorGUI.EndChangeCheck();
    44.                 break;
    45.             default:
    46.                 typeIn = false;
    47.                 property.stringValue = groupName;
    48.                 break;
    49.         }
    50.     }
    51. }
    52.  
    Then you can change your current regular string properties in components to use the attribute, and you will get a drop-down with optional "Type In" field:

    Code (csharp):
    1.  
    2. class MyComponent : MonoBehavior
    3. {
    4.     [SoundGroup] public string coolSound;
    5.     [SoundGroup] public string otherSound;
    6. }
    7.  
     
  44. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I will try this out, thanks for sharing!
     
  45. Jimww

    Jimww

    Joined:
    May 14, 2013
    Posts:
    63
    Hi,

    I'm having a problem where the same sound that is contained within a playlist is playing at about half the volume of when the sound is in it's own group. All the sound levels are set to 1 and I'm not using ducking or custom busses, and the crossfade is set to 0. I have no idea what can be getting in the way here.

    Any ideas?

    edit: to be more clear, when I click the speaker icon within the "Group Mixer", the sound is played at full volume. The same sound when it is in a playlist and I click on it's speaker icon, it is half volume.
     
    Last edited: Feb 12, 2014
  46. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I wouldn't go by preview icons to judge whether those volume levels are actually equal. When you preview a playlist clip with the speaker icon, it creates a new Audio Source component on the Master Audio prefab (top-level) just for previewing purposes. That goes away when you press play, but anyway the 3d sound settings of that Audio Source has different default settings than that ones used for Sound Groups. To hear the real volumes, press play and use the Jukebox control that appears at the top of the Master Audio Inspector for Playlist stuff. I'd bet they are equal there.

    It's still useful to have the previewing icon in edit mode for comparing songs in a Playlist against each other.
     
    Last edited: Feb 12, 2014
  47. Jimww

    Jimww

    Joined:
    May 14, 2013
    Posts:
    63
    I actually discovered the problem when I was triggering the playback of a playlist at runtime via code and then also triggering one of it's containing sounds directly via the sound group. That's when I noticed it was much louder, when it got triggered (from code) via the sound group. Then I discovered that the same thing was happening when I just clicked on the speaker icons.
     
  48. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V3.4.1.2 will be live in about 15 minutes. Changelog:

    • Added a "loop playlists" checkbox to Playlist Controllers, defaults to on. If you turn it off, the Playlist will crossfade out the last song and stop.
    • Fixed bug: FadePlaylistToVolume doesn't use the right time when Master Playlist Volume is < 1.
    • Added new Playmaker Custom Action "MasterAudioPlaylistGetCurrentClipName", which stores the result in a string variable for your use.
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok. Well it's likely still just a difference between either the 3D settings in the Audio Sources between PlaylistController (there are 2 each for those) and Sound Group templates, or you might have Playlist Controllers positioned in a different location than the Master Audio prefab so that the 3d settings are behaving differently.
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Jimww, I took a look and the "min distance" 3d sound setting is 1 for Playlist Controller stuff and 0.1 for Sound Group stuff.

    I usually play all music in my games in 2D anyway so I hadn't noticed the difference.

    Should I change these to be the same?