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
    V 4.1.6 changelog:
    • Fixed bug: Occlusion hit triggers for raycasts code was incomplete.
    • Fixed bug: RelationsInspector code would throw errors in Unity Cloud.
    • Fixed bug: EventSounds logs errors to Console if listening to Custom Events.
    • Fixed bug: MasterAudio.IsTransformPlayingSoundGroup returned wrong results most of the time.
    • Fixed bug: Reloading the current Scene would log errors to Console.
    • Fixed bug: Deleting a Sound Trigger event in Event Sounds was not undo-able.
    • Fixed bug: Duck Groups were not removed from MasterAudio game object when DGSC disabled. Instead they were still there but for "[None]" Sound Group.
    • Fixed bug: Doing a Playlist Controller fade while the music is ducked would first reset the volume back to the pre-ducked volume (louder).
    • Fixed bug: Linked Groups did not show Sound Groups from Dynamic Sound Group Creator game objects in the Scene.
    • Fixed bug: Could not preview any Sound Group in a Dynamic Sound Group Creator if no MasterAudio game object is in the current Scene.
    • Added "Trigger Stay" & "Trigger Stay 2D" event to Event Sounds, with an amount of seconds to wait before performing the audio events.
    • Added "Add Song To Queue" to Event Sounds for Playlist Controllers.
    • Added "GlideByPitch" API to Variation. You specify target pitch and how long the glide takes, with optional callback.
    • Added "GlideByPitch" option to to Sound Group, with optional callback.
    • Added "GlideByPitch" option to to Bus, with optional callback.
    • Added "Glide By Pitch" option to EventSounds script in the Inspector for Play Sound, and to Group Command, and to Bus Command with Raise Pitch and Lower Pitch options.
    • Added "ToggleSoundGroup" and "ToggleSoundGroupOfTransform" API's. They will play the sound if it's not playing and fade/stop it out if it is playing. Also added these options to Event Sounds - Sound Group Command.
    • Fixed compile errors for Unity 2018 and possibly 2017 certain versions?
    • "Use Random Start Position" on each Variation has been renamed to "Use Custom Start/End Position" and now contains another field for "End %" so you can end the clip on a certain percentage.
    • Disabled "loop clip" when using Random Start/End Position, because it wouldn't loop with the clip portion anyway, although we'll try to add this feature later.
    • Looped Chain transitions from one Variation to another are now seamless!
    • End Linked Group transitions are now seamless!
    • Removed "FX Tail Time" and "Add Filter FX" dropdown from Sound Groups. FX Tails and effects should be done on the Unity mixer.
    • Added API to cancel the auto-unsubscribe SoundFinished delegate (if any) on a Variation. To use it, call the following: MasterAudio.GrabGroup("SoundGroupName").WillCleanUpDelegatesAfterStop = false;
     
    MudPuppet likes this.
  2. GT500

    GT500

    Joined:
    Apr 24, 2015
    Posts:
    8
    Quick Question,

    In your video I see you are attaching it to existing game objects. Is you audio manager straight forward to attach/configure through code if game objects are instantiated at runtime.

    Will look deeper into other videos and the docs in the meantime :)

    EDIT: I should have looked before I asked... thanks I checked the docs http://www.dtdevtools.com/docs/masteraudio/TriggeringAudioCoding.htm
     
  3. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    138
    Allright, cool. Glad you are sorted.
     
  4. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Registered with your boards to post this there, but I just get stuck on a blank "Redirecting..." page when clicking login. So, I'm posting here instead.

    I would really appreciate being able to define buses in assets (e.g., ScriptableObject instances). To ensure that levels are playable without returning to a main menu, I include a MasterAudio and PlaylistController prefab in scenes. I let duplicates be destroyed when loading from one level to another. However, the only way I can get buses to reliably work is to use the "new bus" option (rather than "existing bus"). And, even if I could use "existing bus", it would break if I ever wanted to change the name of the bus. Defining buses in assets and dragging them in as references would solve both of these problems.

    In addition, I would also like a global setting to disable the messages that inform me of duplicate MasterAudio and PlaylistController deletion, as I have to comment out those lines every time I update Master Audio.
     
  5. churi24

    churi24

    Joined:
    Sep 17, 2013
    Posts:
    98
    Hi, I need pause & resume the entire MasterAudio. Which methods should I use?
     
  6. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Thanks for the update, will this feature be implemented any time during next few months? (before June?) Just need to plan our stuff.. accordingly..
     
  7. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
    How is the correct behavior to use Unity Timeline with Master Audio?
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Again, I wasn't notified of responses to this thread, so sorry.

    The first one will not happen (and your assumption is correct, so you will need to find the buses and fix them if you choose that option), the 2nd request I've added to roadmap.
     
  9. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There are MasterAudio.PauseEverything() and MasterAudio.UnpauseEverything() commands.
     
    churi24 likes this.
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Did the update today. Should be live in a few minutes.
     
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No idea. I don't know how timeline works. We haven't build anything for it although there's an item on the roadmap.
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    V 4.1.7 will be live in 20 minutes. Changelog:

    • Fixed compile error on Unity 2017.1.
    • Fixed unpause mixer bug with Null Exception.
    • Fixed bug: MasterAudio.TriggerNextPlaylistClip did not do SynchronizeClips correctly for non-layered music with 0 Crossfade. It should work like the Next button in Jukebox. It should keep the position, not start at beginning.
    • Fixed bug: Variation pitch would not always reset to original pitch on subsequent plays after GlideByPitch was used.
    • Added "FadeOutAllSoundsOfTransform" to Master Audio API and to EventSounds script.
    • Added "SoundLooped" delegate callback to Variations so you can get notified each time the audio loops back to the beginning.
    • Added "Use Finite Looping" section to Variations so you can loop X times, then it will stop. Also has a Min / Max Loops field to choose a random number within the range.
    • Added Master Audio Clip Manager for Unity 5+! Now you can bulk change import settings for all your audio clips, with file name / path filters and paging.
     
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
  14. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Hi Brian

    I am playing all song's stems simultaneously, and muting and unmuting each stem based on events in my game.

    Is MasterAudio better suited for this or should I continue using Unity's built-in audio system?

    Is there a reached-end-of-song event in MA?

    Would you know which is more efficient?

    I use MA for my multilingual app and I was wondering what is the best approach?

    Thanks
     
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Piece of cake for Master Audio. We have built in crossfading so you don't have to instantly mute, which would sound better. Also built in music ducking and a ton of other SFX functionality you probably don't have.

    Yes there's an end of song event. All the code is extremely efficient and optimized.

    There's also built in multi-language support with Resource folders.

    I would point you to this thread for further points.
    http://darktonic.freeforums.net/thread/130/unity-great-master-audio-absolutely
     
  16. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Very cool

    If someone chooses to play another mix of same-length stems by download, what do I need to package or update?

    In other words, I want users to download songs (of whatever number of stems) and keep them in their devices, is there a way to package a Master Audio set of playlists and unpackage them locally?

    Thanks
     
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No we do not support loading audio files from a device. They must either be packaged with the Unity project, in a downloadable unity package or downloaded via URL from the internet.
     
  18. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Oh... what do you mean? Do you mean playlist song looping middle part feature is implemented now? Just asking because the change log didn't say anything about that. Just got bit confused.
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sorry, the only part in the update is for SFX, not playlists. Looped chains and "stop linked" groups now play seamless. Playlist stuff may be done by summer, but probably not because I'm going to focus on the Android no latency play native code next and not sure how long that will take.
     
  20. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Oh.. Ok, Sigh. Thanks for letting me know.
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Any time.
     
  22. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Not sure what I am doing wrong:

    I am running this:
    Code (CSharp):
    1. if (Input.GetKeyUp(KeyCode.A))
    2.         {
    3.             MasterAudio.StartPlaylist("keys");
    4.         }
    5.  
    6.         if (Input.GetKeyUp(KeyCode.B))
    7.         {
    8.             MasterAudio.StartPlaylist("drums");
    9.         }
    and the following error shows up:
    Code (CSharp):
    1. You cannot call 'PausePlaylist' without specifying a Playlist Controller name when you have more than one Playlist Controller.
    2. UnityEngine.Debug:LogError(Object)
    3. DarkTonic.MasterAudio.MasterAudio:LogError(String) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:7046)
    4. DarkTonic.MasterAudio.MasterAudio:IsOkToCallOnlyPlaylistMethod(List`1, String) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:7060)
    5. DarkTonic.MasterAudio.MasterAudio:StartPlaylist(String, String) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:6011)
    6. DarkTonic.MasterAudio.MasterAudio:StartPlaylist(String) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:5997)
    7. MasterAudioSliders:Update() (at Assets/MasterAudioSliders.cs:16)
    8.  
    Is that how you play a synchronized playlist? I am either starting with all playlists playing back or just one, how would you do that?

    Thanks
     
  23. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Also, I am also interested in changing the volume of the playlists using ugui sliders, is that possible?

    Thanks again
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The error is saying the wrong method name, just fixed that.

    Anyway, to start one of the playlists, you have to tell it the name of the Playlist Controller game object since you have more than one.
    Code (csharp):
    1.  
    2. MasterAudio.StartPlaylist("keys", "your playlist controller name that will play it");
    3.  
    Each Playlist Controller will host a single playlist, and they will all host different playlists.
     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yeah, and it's built into Event Sounds script, just add it to the slider game object and pick Playlist Control, Set Playlist Volume or Fade To Volume action.
     
  26. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392

    Thanks!

    These two playlists playback like this:
    Code (CSharp):
    1.        if (Input.GetKeyUp(KeyCode.A))
    2.         {
    3.             MasterAudio.StartPlaylist("keys", "keys");
    4.         }
    5.  
    6.         if (Input.GetKeyUp(KeyCode.B))
    7.         {
    8.             MasterAudio.StartPlaylist("drums", "drums");
    9.         }
    However they are not synced. Each has the 'song transition type' set to 'synchronize clips' and when I type A and later B they are not playing the same timeSample.

    Just checking if I have things correctly:
    I have 8 stems all of same length

    - each stem is a PlaylistController
    - in Master Audio prefab > Playlist setup > 8 playlists, each with the same same as the PlaylistControllers (keys, vocals, drums, etc)
    - in Master Audio prefab > Playlist Settings > each PlaylistController is assigned a Playlist.

    Thanks again Brian.
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I wrote some code to start stems at different times and they sync'd up fine. The Input.GetKeyUp thing didn't work for some reason (didn't do anything). Not sure if it's a problem with that Unity code or what.

    The only other setting is to make sure that you're using the same "Sync Group" for the ones that are supposed to synchronize together. If you are already doing that, you'll need to send me an example project that reproduces the problem. Can't reproduce it over here.
     
  28. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    I am now using a SpriteRenderer to start playback when clicked/tapped but it was not synching either (I wasn't using a sync group):
    Code (CSharp):
    1. public void Clicked (string stemName)
    2.     {
    3.         MasterAudio.StartPlaylist(stemName, stemName); // I am sending stemName using EventTrigger so I ended up renaiming both playlist controller and playlist the same
    4.     }
    When I started using a sync group it worked. Is that the correct usage?

    What I need to do now is:
    - detect whether a playlist is muted
    - fade in volume the first time StartPlaylist is executed on a playlist

    I wonder if I am using this playlist feature correctly, it is almost as if all stems should live inside a single playlist, but I followed your video named: Master Audio: Synkro - layered music tutorial (HD) so I assume the way you do it is correct.

    Any feedback will be appreciated and thanks
     

    Attached Files:

    Last edited: Apr 19, 2018
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Must use the same Sync Group or it will not work. What happens is that when a Playlist starts playing, it looks for any other Playlist being played with the same sync group. If it finds one, it syncs the time to be the same.

    Why would all stems live inside the same Playlist? The Playlists should be unique if you have layered (stem) music. You could put alternate stems in the same Playlist (like guitar melody 1 / alt 1 / alt2) but not the same instrument in different Playlists.

    Detect if Playlist is muted or not:
    Code (csharp):
    1.  
    2.  var isMuted = PlaylistController.InstanceByName("controllerName").isMuted;
    3.  
    Check the checkbox for "Fade In First Song" on the Playlist top section.
     
  30. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Thanks for the clarification

    Keep making Master Audio more awesome!
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Will Do!
     
  32. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    shoot

    I thought I was going to give you a break but I am having trouble with the following line, the check is always false:
    Code (CSharp):
    1. PlaylistController.InstanceByName(stemName).IsSongPlaying(stemName)
    Basically I never enter the second part of the loop, the else, when _isPlaying is true

    Code (CSharp):
    1. public void Clicked (string stemName)
    2.     {
    3.         _isMuted = PlaylistController.InstanceByName(stemName).isMuted;
    4.         _isPlaying = PlaylistController.InstanceByName(stemName).IsSongPlaying(stemName);
    5.  
    6.         if (!_isPlaying)
    7.         {
    8.             MasterAudio.StartPlaylist(stemName, stemName);
    9.         }
    10.         else
    11.         {
    12.             if (!_isMuted)
    13.             {
    14.                 MasterAudio.MutePlaylist(stemName);
    15.                 Debug.Log(stemName + " is muted");
    16.             }
    17.             else
    18.             {
    19.                 MasterAudio.UnmutePlaylist(stemName);
    20.                 Debug.Log(stemName + " is playing");
    21.             }
    22.         }
    23.     }
    :)
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You will need to pass the name of a "song" not the Playlist into IsSongPlaying. A song would be the name of an audio clip. If you wanted to know if any song is playing there's a different API call.
     
  34. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    so when I run these:
    Code (CSharp):
    1. MasterAudio.MutePlaylist(playlistName);
    or
    Code (CSharp):
    1. MasterAudio.UnmutePlaylist(playlistName);
    I get a sharp mute obviously, but I was also trying to mute with FadeToVolume:
    Code (CSharp):
    1. PlaylistController.InstanceByName(playlistName).FadeToVolume(0f, 0.5f);
    But muting is still abrupt.

    Any ideas about making the muting process smoother?
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You'll probably need a higher value than half a second. Not sure how many frames a second you're running.
     
  36. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Right now it's 1 second

    and the frame rate is 59fps on the editor

    Using MasterAudio.MutePlaylist(playlistName); is the best solution since I can detect when a track is muted as opposed as using MasterAudio.FadePlaylistToVolume(playlistName, 0f, 1f); which in addition to fading it also stops playback of the playlist.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    FadePlaylistToVolume only stops the Playlist if you've selected the option under Advanced Settings / Fading / Playlist Controllers. The default is not to stop.

    Anyway what you want is to call that method from the PlaylistController, because there's an optional callback you can use there. If you have only one, the code is this:

    Code (csharp):
    1.  
    2.   MasterAudio.OnlyPlaylistController.FadeToVolume(0f, 1f, delegate {
    3.    // add code to do something after fade
    4.   });
    5.  
     
    gegagome likes this.
  38. HeavyProduction

    HeavyProduction

    Joined:
    Aug 12, 2016
    Posts:
    28
    I am noticing that any GameObjects with Master Audio components on them are slowing down the inspector? I am using 2017.4.1 and the latest version of Master Audio available from the Asset Store.
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    How you would know that it's slower or by how much?
     
    Last edited: Apr 26, 2018
  40. HeavyProduction

    HeavyProduction

    Joined:
    Aug 12, 2016
    Posts:
    28
    Ill aim to provide a video today of the issue. When scrolling the inspector its slow / lagging compared to other inspectors without MA / CGK components on them (I realise we are in MA thread here, just pointing that out as recently upgraded both packages).
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I doubt there's anything that can be done. That's not really a major issue as I see it.
     
  42. HeavyProduction

    HeavyProduction

    Joined:
    Aug 12, 2016
    Posts:
    28
    Its odd, never had it before (been using these kits for years now) and this is the first time ive seen the slow downs.
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The code hasn't changed. My only guess is you are using a Scene with a huuuuuuuuge amount of Game Objects (or Sound Groups) because it does scan the hierarchy to get the list of Sound Groups for the dropdown. And maybe before your old projects didn't have so many.
     
  44. HeavyProduction

    HeavyProduction

    Joined:
    Aug 12, 2016
    Posts:
    28
    I'll investigate. To be clear, I was using 2017.2, upgraded to 2017.4.1, updated MA, then started seeing the issues. Same project, no other changes.

    Ill keep an eye on it and see if I can notice it in other unity versions. The project does not have that many GO's in it.
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Updated MA from how old of a version? Extremely old?
     
  46. HeavyProduction

    HeavyProduction

    Joined:
    Aug 12, 2016
    Posts:
    28
    Would of been around August 2017 the last version I had in the project.
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, well the code for Inspectors hasn't really changed at all since I wrote it.
     
    HeavyProduction likes this.
  48. HeavyProduction

    HeavyProduction

    Joined:
    Aug 12, 2016
    Posts:
    28
    Must be an editor issue. Ill test some more
     
    jerotas likes this.
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok.
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio and Core Gamekit are both 30% off for two weeks starting today! Heads up to anyone waiting for a price break.