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. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    138
    Really sorry, everyone. We screwed up our last Master Audio submission and Unity has pulled it until they approve the new version, which we're expecting imminently.

    If you need to get Master Audio set up right now, email your invoice # to support@darktonic.com and we'll email the UnityPackage to you so you can be up running ASAP.

    Sorry for the inconvenience!
     
  2. LoftyTheMetroid

    LoftyTheMetroid

    Joined:
    Oct 26, 2012
    Posts:
    57
    Cool, thanks!
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    We're baaaaack! Master Audio V 3.1.3 is on the Asset Store!
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V 3.1.4 is submitted to the Asset Store. Changes are:

    • Fixed bug with bus voice-limiting code.
    • Fixed bug where PauseSoundGroup and UnpauseSoundGroup didn't work with Dynamic Sound Group Creator sounds.
    • Made a setting to allow unpausing paused Resource file clips. Defaults to off and will unload a Resource file that's paused.
    • Added a method to add songs to a Playlist through code.
    • Added bus filter dropdown to Group mixer section to only show Groups in the selected bus from a dropdown.
    • Added overloaded methods of PlaySound and PlaySound3D, which will take soundGroupIndex (int) instead of string sType - only advised if you have an enum defined in your code, can convert it to an int and keep track of the numbers when orders change (it's alpha sorted).
    • Added new Playlist Song Transition Type of "New Clip From Last Known Position", which will start a song from the place it last cross-faded from if it's been previously played. If not, it does new clip from beginning on that song. Note that your previous settings of "Synchronize Clips" will turn into this new option, so go re-select Synchronize Clips again after updating.
     
  5. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Man, that's fast. That's what I called SUPPORT !!
    No other extension developer on Asset Store are pushing out almost DAILY update (and new features!) like this!!
    Seriously, you guys are the most dedicated Asset Store developer I have seen so far. Keep up the good work! We all really appreciate it!! :)
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thanks da bawss! We love you guys too!
     
  7. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V3.1.4 is released! Grab them new features.
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There's a bug with MasterAudioManager, the window that creates Master Audio, Prefab Controllers, etc. It didn't have the pointer to the new DarkTonic folder. Here's a fix if you don't want to wait for the next version.

    View attachment $MasterAudioManager.cs
     
  9. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    Thanks for the update.

    I have another question. I am trying to detect the end of a looped sound playing. The sound is very short (0.5 seconds) and I am looping it 5 or 6 times before it is stopped manually via code. This is just a test sound for now which is why it is so short.

    I wanted to subscribe to an event when the sound was done playing (i.e. stopped) so I could do some internal cleanup. I used SoundResult.ActingVariation.SoundFinished, but it seems to non-deterministically fire sometimes in the middle of the sequence of 5 or 6 loops or sometimes it doesn't fire until I manually ask the sound to stop at the end.

    I looked in the code and it appears you are polling for the sound to be finished:

    if (this._audio.time == 0f || this._audio.clip.length - this._audio.time < Time.deltaTime * FRAMES_EARLY_TO_TRIGGER)
    {
    break;
    }

    I am not sure why the magic # is for tbh, it looks like you are making an assumption about the frame time based on the last delta time and trying to bail a little early, but in any event, I wondered why you implemented with a poll and looked up Unity's implementation, which implemented polling, and then I looked up FMod's implementation, which is polled as well. Utter rubbish on FMod's part. I implemented my own sound manager in DX5 a decade ago that could fire a completely accurate event for this no matter if I was streaming the sound from disk or from memory, etc. In any event, I guess we are stuck with what Unity and Fmod gave us.

    So is there a way to reliably know when a sound has stopped playing? I.e. using this event or does this event mean something different (e.g. when a single sound "loop" is done)?
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The code may in some cases stop the sound 1-2 frames early. My thinking was that's better than stopping late and having a gap in sound if you wanted to play another sound right after it. Anyway you can't really hear 2 frames get cut off even at 30fps so it doesn't really matter. I haven't seen the SoundFinished code fire super-early...but yes, it does tell you when a single loop is done. Nothing happens after that. Your event subscription is cancelled.

    If you would like to fire code *every* time a loop re-loops, use the EventCalcSounds script. That's what it does. I've purposely not built that functionality into every Variation script because it would be terrible on the CPU.
     
    Last edited: Dec 21, 2013
  11. beezir

    beezir

    Joined:
    Apr 3, 2009
    Posts:
    133
    When I targetted my app for Windows Phone 8, I ran into a small issue with Master Audio. The SortedList type is not supported on that platform. I worked around it by changing the SortedList<string, AudioGroupInfo> on line 71 of MasterAudio.cs to a SortedDictionary<string, AudioGroupInfo>. Most of the code is compatible, but there were a couple other changes needed further down. Around line 778 and line 825, it plays sounds by key index, which you apparently can't grab directly from a SortedDictionary.

    I don't actually use these specific functions, so I have no idea if my fix is remotely correct, but feel free to play around and make this code not crappy:

    Code (csharp):
    1.  
    2.         var i = 0;
    3.         var sType = "";
    4.         foreach (var k in audioSourcesBySoundType.Keys)
    5.         {
    6.             if (i == soundGroupIndex)
    7.             {
    8.                 sType = k;
    9.                 break;
    10.             }
    11.             i++;
    12.         }
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you. I don't see a way to improve that code you posted with a SortedDictionary, which is limited. I have made the changes, but added them as specific to Windows8 phone platform. The old code (SortedList) remains for other platforms.
     
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V 3.1.5 is submitted. Changelist is:

    • Fixed bug where prefabs for Master Audio Manager window weren't found.
    • Made SoundFinished event for Variations only trigger when the clip has stopped, whether normally when the non-looping clip ends or you call the Stop method. Before it would trigger when the clip had re-looped as well.
    • Moved preview buttons in Variation up to a bar up top. Added a button there to go "back to group".
    • Removed rename Variation controls in Group Inspector. Moved other controls up to the title of the Variation to match Variation Inspector.
    • Fixed Win8 phone compilation bug with platform-specific compilation.
    • Fixed bug when clicking Equalize Volume where having more than one clip with the same average volume would cause an error in the console.
     
  14. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Thanks. Can you add in method for me to build the int index.

    // return -1 if not found
    int GetSoundGroupIndex (string soundGroupName);

    I notice there is a RunTimeSoundGroupNames, but I presume I cannot assume their order.
     
    Last edited: Dec 23, 2013
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sure, no problem.
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V 3.1.5 is live! Bug fixes mostly, but the UI has some minor improvements.
     
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If you want to go ahead and add this to MasterAudio.cs, it does the trick for non-Win8phone platforms.

    Code (csharp):
    1.     /// <summary>
    2.     /// This method will give you the index of a Sound Group. Returns -1 if it doesn't exist
    3.     /// </summary>
    4.     /// <param name="sType">The name of the Sound Group to check.</param>
    5.     /// <returns>Returns the index of the SoundGroup if it exists, otherwise -1</returns>
    6.     public static int GetSoundGroupIndex(string sType)
    7.     {
    8.         return audioSourcesBySoundType.IndexOfKey(sType);
    9.     }
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Heads up, there are bugs with the "follow sound-maker" code for looped sounds, and also a bug playing code from Start event of any scene. I've fixed them and they'll be in the next version.
     
  19. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    happy holidays to both of you and your families! thanks for the release!
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you im! You as well!
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    MasterAudio V3.1.6 is submitted. A couple bug fixes and a request, nothing huge this time.

    • Added GetSoundGroupIndex method to MasterAudio.
    • Fixed Start event sound triggering. This broke when I added bus voice limit controls.
    • Fixed bug where Variation following of the "sound maker" didn't continue after the clip looped.
     
  22. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    When you have a playlist controller with nothing in it, it insists on throwing warnings:

    // Debug.LogWarning("Current Playlist is NULL. Subsequent calls will fail.");

    A null playlist should be perfectly valid IMHO. Since this gets polled in fixed update, it continuously gets logged. I've commented it out for now.

    In addition, why doesn't this obey the normal "log all sounds" in MasterAudio?
     
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    This logging is to let you know what happened when you try to perform an operation on a Playlist if you haven't set one. You obviously can't call next clip, stop, pause, etc if you have no Playlist to operate on. Instead of commenting it out, use the variable instead of the property to eliminate that logging during FixedUpdate. Like so:

    Code (csharp):
    1.  
    2.     private bool IsAutoAdvance {
    3.         get {
    4.             if (currentPlaylist != null  currentPlaylist.songTransitionType == MasterAudio.SongFadeInPosition.SynchronizeClips)
    5.             {
    6.                 return false;  
    7.             }
    8.            
    9.             return isAutoAdvance;
    10.         }
    11.     }
    12.  
    currentPlaylist should be lower case. I've fixed this and it will be in the next version.

    The logging setting is not intended for Playlists. Anyway as I said, this error is only to help when you're calling a method and forgot to do a null check.
     
    Last edited: Dec 28, 2013
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V3.1.6 is live! Grab your bug fixes.
     
  25. NickHVenden

    NickHVenden

    Joined:
    Aug 3, 2013
    Posts:
    33
    Thank you so much for Master Audio and Synkro! I'm at work on a thesis project for a Master's degree in interactive media at CSULongBeach Ca. It involves a interactive music composition embedded in a Unity game. I purchased the software but I'm having trouble with the "fade between (synchronized) clips" in the jukebox during Play mode. Followed the videos several times and still can't get it to work. I set up two Playlists with identical-length clips and attached one each to two separate playlistControllers. If you can help, I'd appreciate it.
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I can help, but I'd need to know exactly what problem you're encountering. I haven't seen any issues with that functionality myself. You can email support@darktonic.com, post here with more details, or catch me on Skype in the evening (Seattle time PST).

    Thank you!

    Oh...did you want to put both clips in the same Playlist? That's what I think you're trying to do. I don't think you need two Playlist Controllers unless you're layering music.
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'd like to ask all Master Audio users if there's a particular tutorial video they'd like to see? I don't have any on the agenda right now.

    Thanks and happy new year!
     
  28. Hesham

    Hesham

    Joined:
    May 29, 2008
    Posts:
    147
    I'm looking at migrating my current project to Master Audio. I have a few simple questions:

    1- I know I can have music playing between scenes if I persist the prefabs. Correct?
    2- I will have around 100 scenes with each scene having some unique sounds and some shared sounds. I read that I can configure per scene FX, can you elaborate?

    Thanks
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    #1 correct.
    #2 - there's a prefab called Dynamic Sound Group Creator that you use to configure per-scene audio when you use persist mode. Using that is very similar to using the Master Audio mixer setup in the main prefab and requires no coding. The sounds that all scenes need you will setup in the main Master Audio prefab.
     
  30. Hesham

    Hesham

    Joined:
    May 29, 2008
    Posts:
    147
    Great. The move is going very smoothly. I have one more question:

    I have setup MasterAudio in the first scene with all the common FX. Now for the next scene I have added the per scene prefab, however, what should I do if I wanted to test the scene with all the FX (the common ones, plus the scene specific ones)?
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Unfortunately, you will have to go to the first Scene (the bootstrapper Scene that has the MasterAudio prefab), hit play and then somehow get to the Scene you've added per-scene audio to - like making a button to "go to Scene X". I know this isn't optimal, but that's what you have to do. Any plugin that allows persisting prefabs has this same problem, so I'd be surprised if you haven't run into this before. I know I have with Playhaven and others.

    Alternatively, you can make your own prefab for your MasterAudio in the bootstrapper Scene, then drag that prefab it into the scene you're testing per-scene audio in during testing, then delete it when satisfied. That won't test the persisting, but you will see the same result otherwise.
     
  32. Hesham

    Hesham

    Joined:
    May 29, 2008
    Posts:
    147
    Yeah, I have run into this before. I was just hoping that maybe there was a workaround somehow.

    However, I'm amazed how efficient Master Audio is. I migrated from another sound package that is aimed at mobile, but experienced some stutters both sound and gfx wise. I have yet to see any stutter with Master Audio even in my busiest scenes.
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That's likely at least partially because we don't Instantiate anything after the Awake event. It's all pooled up front. Some other plugins say they pool, but they really only pool after Instantiating on demand. I would refer to that as only half pooling really. Care to mention which competitor plugin it was? Even privately if you prefer. I'd appreciate knowing.

    There's also other tricks I won't reveal that we used to optimize (minimize) the CPU cycles taken up. It's easy to find if you examine the code though if you're a coder.
     
    Last edited: Jan 2, 2014
  34. Spagnutty

    Spagnutty

    Joined:
    Jun 1, 2012
    Posts:
    3
    Is there any support for custom loop points (hopefully sample accurate)?
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Not currently. How would you like it to work? And why would you not actually trim down the sample to the size you want to save on memory usage instead?
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    In testing today, we discovered that having inactive Filter FX components in the Variation scripts actually takes up audio RAM, so I will be making it so they don't get created that way automatically and also provider a button to remove all unused ones from existing Master Audio prefabs.

    The next update will fix this.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I have added Resource file support for Playlists finally! The next update will have this. Automatic memory management, just set it up in the Inspector!
     
  38. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    thanks! nice!

    happy new year!
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V 3.1.7 is submitted to the Asset Store. Changes are:

    • Added Resource file support to Playlists! Automatic memory management, same as Sound Groups. Drag and drop!
    • Fixed unneccessary error logging in Playlist Controller when no Playlist is set up.
    • Fixed bug where a looped Sound Group Variation would fade out before looping. Looped clips should ignore fade out time. Also put a note in the UI so the user knows this.
    • Added Variation Sequence to Dynamic Sound Group Creator inspector, same as Sound Group.
    • Added Variation Mode to Dynamic Sound Group Creator inspector, same as Sound Group.
    • Removed all 6 Filter FX from SoundGroupVariation template. They take up memory even when not used.
    • Added a button in Master Audio Manager window to delete all unused Filter FX Components from the MasterAudio hierarchy.
    • Added a dropdown in Variation's Inspectors to quickly add any of the 6 Filter FX Components to the Variation.
    • Added more obvious red highlighted rows to differentiate setup errors from the green notes that tell you non-error helpful hints.
     
    Last edited: Jan 5, 2014
  40. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V 3.1.7 is live! Now you can optimize your audio memory usage with the new additions!
     
  41. Anderz

    Anderz

    Joined:
    Dec 5, 2013
    Posts:
    24
    After this update, I now get this compile error:

     
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, I found it. That file was removed after I changed the "follow sound-maker" behavior to not really attach but just follow. You can delete that file. I wish there was a way for the updated package to automatically do this, but I couldn't find a way to do that. I will update the release notes for that version. Thank you for telling me about this.
     
    Last edited: Jan 7, 2014
  43. Anderz

    Anderz

    Joined:
    Dec 5, 2013
    Posts:
    24
    No worries, thanks for the swift response. Deleting the file did the trick. :)
     
  44. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Did a small update just now, submitted! Changes are:

    • Fixed bug where Playlist auto-advance to the next song didn't work when timeScale is set to zero.
    • Added setting for default begin ducking percentage, which will be used for any new groups you add to Ducking.
    • Added configurable begin ducking time in Dynamic Sound Group Creator groups, defaults to the default begin unduck percentage if MA prefab can be located in the Scene.
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    V3.1.8.1 is live, heads up!
     
  46. Sammons

    Sammons

    Joined:
    Aug 27, 2013
    Posts:
    18
    I Just updated to V3.1.8.1 and I am now getting this error after importing Playmaker actions.

    Assets/DarkTonic/MasterAudio/PlaymakerCustomActions/MasterAudioDuckingAddGroup.cs(12,29): error CS1501: No overload for method `AddSoundGroupToDuckList' takes `1' arguments

    I'm using the latest version of Unity and Playmaker.
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Oops, I forgot to check custom actions. Sorry about that. Here's that custom action fixed.
    View attachment $MasterAudioDuckingAddGroup.cs

    I'll do a hotfix for this soon.
     
  48. Sammons

    Sammons

    Joined:
    Aug 27, 2013
    Posts:
    18
    Thanks! One more reason I don't regret buying MA+KW.
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you kindly ;)
     
  50. Adalberto_VL

    Adalberto_VL

    Joined:
    Mar 7, 2013
    Posts:
    11
    One question... I'm trying to make a dynamic soundtrack using synchronized clips , I use the EventSounds script to play a specific clip when I enter an invisible trigger but if I turn back and enter again the sound stops because its trying to play the same clip that's already playing. Is there a better way to make a dynamic soundtrack or is there an easy way to write a condition in the code to ignore if the track is already playing?