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
    We already have a "load from resource" no-coding solution. If you have a lot of audio, you should put your infrequently used audio files in as Resource files instead of just normal audio clips. To do this, go to the Sound Group's Inspector, and change Audio Origin from Clip to Resource File. Then, after you've moved your audio file to a location under a folder named "Resources" somewhere (subfolders under that are allowed), go ahead and drag that audio file into the "drag resource file here" area that is above Resource Filename, and the latter field will be populated with the correct path for Master Audio to use it during runtime.

    After you've configured resource files like this, they will not be loaded into memory at runtime until you tell Master Audio to play that sound. When you do, it will quickly be loaded into memory (there's obviously some latency in this since we have to wait for the file to finish loading) and then it will play. After it's done being played, it will be unloaded and the memory will be released.

    2 things about streaming.

    1) Note that streaming audio memory usage does not show correctly while running inside Unity. It's greatly exaggerating the memory usage needed by streaming on Android and iOS devices. In fact the memory usage on those platforms is near zero.
    2) Streaming does not work with Resource files (that's a Unity limitation, not Master Audio's). The file will be completely loaded into memory even if you mark it as streaming.
     
    Last edited: Aug 11, 2014
    hopeful likes this.
  2. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    393
    OK that sounds like we could have a solution here. I have a point and click style adventure title that has a large array of AudioClips for each of the thoughts the player has per object. With your suggestion it looks like I can move each of these clips to the Resource folder. The only problem I can see is the latency before the clip is played. What kind of latency are we talking? The clips are relatively short (<10s). Obviously I can't have a noticeable pause from when a player inspects an object to the AudioClip playing.

    Many thanks for your very swift and informative reply!
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The larger the clip is, the more latency. I couldn't give you a guess, but the latency will be longer on the device vs on the PC. Maybe 50 - 200ms?

    If you know in advance that you'll want to play the clip, you could load it a few frames early, and then play it with a delay.

    Other than that, there's no way around it.
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I had a chance to look into this today. It seems to work fine for destroying objects (didn't try during a Scene change where Master Audio is also being destroyed), but it doesn't work when the parent object is being disabled. Then what happens is that the Variation that was childed will also get disabled. And there is apparently no way to re-enable it until after the event has finished. Now, since almost everyone uses Pool Manager and the like to pool objects for massive performance increases, most of the time objects would be disabled (despawned) and not destroyed. So we will not be changing the "follow" code to reparent.

    Thank you.
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V3.5.4.8 will be live in 20 minutes. Changelog:

    • Fixed bug where previewing in edit mode on the Master Audio prefab, Groups, and Variations (as well as the Dynamic Group Creator) wouldn't always play the sound until you clicked something else.
    • Made previewing respect the Group's volume in edit mode on the Master Audio prefab, Groups, and Variations (as well as the Dynamic Group Creator).
    • Fixed bug where selecting GroupVariation in Project View would log bogus errors.
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I will take a look at the performance again next week and see what I can trim down on the GC front. It's on the official to do list :)
     
  7. awejk

    awejk

    Joined:
    Oct 13, 2012
    Posts:
    32
    thanks in advance, especially pay attention to EventSounds incredibly voracious, 1.1 kb at a time, that's a lot.

    I have a Samsung Galaxy Tab 3, and during the two calls EventSounds I see a little lag, naturally, with the following calls it almost imperceptibly. Sorry if I somehow offended. But I didn't realize that it was possible to write such that a simple audio playback requires 500 bytes. I understand that fade easier to do through StartCoroutine but it is also the memory allocation and it can be easily replaced with a different implementation without memory allocation. This is my opinion and I do not impose you to fix something, if Your users are happy, then let things remain as they are. And this despite the fact that the mere sound in Unity does not require memory allocation at all. Again sorry if hurt you.
     
    Last edited: Aug 14, 2014
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No offense taken. SoundManagerPro has a very small allocation, but then it's missing pretty much all of the group limiting / polyphony / bus voice limiting / random or ordered variation options and all that sort of thing that our product has. Those are what take some (most?) of the 500 bytes. It's not as simple as you are thinking - perhaps you're not using any of these myriad of powerful options that Master Audio provides, but the code still needs to check for them. I believe the variation randomizing code is part of the allocation. Not sure about Audio Toolkit, it may have some of the options, but definitely not all.

    Event Sounds I believe has to return an object for one edge case, which is probably why it's larger. I will be taking a look. And if you're an allocation expert (not sure), and can offer suggestions on how to lower the memory usage, I would also appreciate that. Not at the cost of any of our options going away though.

    About the CoRoutine for volume. I opted to not have any code in Update because when you start to have a lot of Variations and they each have many clones and they all run Update code, that could be a serious performance hit constantly. So instead we only start up the CoRoutine for currently playing Variations that need to fade, and a couple other things. If you have a better idea, I'm all ears :). For example in our game we have 90 Sound Groups and about 150 Variations at once, but probably only 4-6 sounds play at once ever. "Update" code on all 150 would be a no go.
     
  9. awejk

    awejk

    Joined:
    Oct 13, 2012
    Posts:
    32
    well, possibly some functionality that supports your library really needs this quantity of memory, so be it. I just wanted to say the first post that if it is possible to reduce the memory allocation that would be good. Otherwise, we'll consider it payment for all the functionality that it provides.
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Fair enough. I'll check on it a second time, soon.
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Hi All,

    The Dialogue System for Unity v1.3.3 just introduced support for Master Audio! You can control all Master Audio features from cutscene sequences and conversations. It's great for ducking background audio during conversations and barks!
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Awesome Tony! His product also has support for our other plugin Core GameKit, and a really large list of other great Asset Store plugins.
     
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Well I found an easy one to fix for GC allocation reduction, regarding the logging. It saved about 30% :) I'll see if there are any others that can be reduced.
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, I found quite a few things where allocation could be avoided. Now we are using
    121 bytes to play sounds (down from ~500) and event sounds uses 165 bytes (down from ~1000).

    These changes will be in the next update! The remaining GC is from some CoRoutines. I will look into a non-CoRoutine idea that I have to get those down as well, but not for a little while.
     
  15. jerotas

    jerotas

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

    • Overhauled performance of Button Clicker script, Master Audio script and several others. Now have 80-90% less Garbage Collection allocation throughout and much faster performance.
    • Added Behavior Designer task package so you can add these if you already own Behavior Designer.
     
  16. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Hi Brian,
    I wrote an email to support on 6th of August but never received an answer. Could you check your spam please?

    Also I ran into a strange problem. In scene A I fade out my playlist in 2 seconds, an in 2.5 seconds I load scene B.
    In the new scene I use FadePlaylistToVolume(1f, 0) to restore the volume to the maximum (I can't find a SetPlaylistVolume method).
    When I play the game in the editor it works fine but when I test it on Android device the music doesn't fade out completely before to load the new scene. Even worst, when the scene B starts, the new music start to maximum but fade out soon.

    This is my code:

    SCENE A
    Code (CSharp):
    1. MasterAudio.FadePlaylistToVolume(0, 2f);
    2. yield return new WaitForSeconds(2.5f);
    3. Application.LoadLevel("SceneB");
    SCENE B
    Code (CSharp):
    1. MasterAudio.ChangePlaylistByName("NewMusic");
    2. MasterAudio.FadePlaylistToVolume(1f, 0);
    I don't know why it doesn't fade out in 2 seconds, but looking you code I know why it continues to fade out also the the new music. In the PlylistController.cs file, function FadeToVolume, you check if the fadeTime is less than 0.1 (in my case is zero) and you directly set the volume to target volume, but you don't reset the FadeMode to None.

    Please let me know if you have a clue on why the fadeout is not respecting the time that I set.
    Thanks.
     
  17. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    With the last update there is a new bug. The randomizerLeftovers list is not filled with Dynamic Sound Groups and it raises and exception every time that I try to play a sound from that group:
     
  18. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    Hi,

    it would be cool if there was a function similar to MasterAudio.ChangeBusPitch(<string>, <float>) that adds its value per clip. You might want to add ChangeBusPitch as well to the Event Sounds Bus Control.

    Cheers!
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yeah, I figured that out right after I submitted it. Will submit a hotfix today.
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V 3.5.4.9a will be live in 20 minutes. Changelog:

    - Fixed the bug mcmorry mentioned 2 posts up about randomizerLeftovers due to the optimization fixes last night.
    - Fixed fade bug so it resets fade mode to none if you do a fade with duration less than 0.1 seconds.
     
    Last edited: Aug 17, 2014
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There's nothing in my spam folder from you, not sure what happened. Sorry about that!

    It's possible that if you had an erratic frame rate that code wouldn't work sometimes. I won't be able to reproduce a device-specific error, however there's a more correct way that should work without fail.

    PlaylistController.InstanceByName("YourPlaylistControllerName").FadeToVolume(.5f, 2f, delegate {
    Application.LoadLevel("SceneB");
    });
     
  22. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    No problem, here is my email:

    Hello,
    I'd like to send you some thoughts and feedback.

    I can't delete the playlist from the main MasterAudio object (and also the last clip).
    I'm using the dynamic sound group creator and it's confusing to have an unused playlist in the main object.

    Also, based on my needs to have a forest with sounds of birds, 1 in background looping + many single sounds to be played randomly, I came to this considerations:

    1. The Randomized variation mode of a group could expose the global settings for all the clips (Random Volume, Delay, etc...) Having 20 or more sound I had to set one by one all the same settings.

    2. For the random mode, would be nice to have a min/max interval between automatic play of the sounds, also more than one at the same time. (I'm not sure if this could be achieved using delay settings). I implemented it by code, but maybe could be useful for other non developer users.

    3. An auto play option for the groups could simplify the play of a background or random sound (without having to add an an empty object with an event to play on start)?

    Yes I saw about the delegate and for sure I'll go that way. Very weird anyway that the time is not respected.
    Thank you for your support and your fixes above.
     
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'll take a look into allowing deletion of the blank playlist.

    #1, I'll look into adding a bulk setting there.

    #2, I don't understand, please rephrase what you want to do. Are you talking about Looped Chain mode?

    #3, I have an Ambient mixer script that I will be adding into the product sometime. That will take care of any number of sounds auto-play.
     
    Last edited: Aug 18, 2014
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Hmm, I don't understand what you want here. Could you say it a different way? What do you mean value per clip?
     
  25. HalfbrickJesse

    HalfbrickJesse

    Joined:
    Aug 18, 2014
    Posts:
    1
    Hey there, I'm having a problem applying Unity Filter FX to a playlist controller. If the controller has effects that are applied, they seem to be ignored, except when a new track is crossfading in. The effects will be applied to the new track until the crossfade is complete, where they'll stop working. The FX components are still enabled, but they're not getting applied to the audio sources.
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I tried to fix this awhile back, but it just doesn't work right with 2 audio sources in the same Game Object, which we need for crossfading to work properly. I don't have a way to fix it. I'm not sure if it's a Unity bug that makes filters not work on a multi-Audio Source object, but there's nothing I can do about it unfortunately. I did notice that it works sometimes and mostly not.

    When Unity 5 comes out, you'll be able to assign both Audio Sources in the Playlist Controller to a Unity audio bus and use filters on it.
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'm working to add something like this. Need to figure out a good UI. As a workaround right now, you can make your settings for one Variation, then clone that variation in the Hierarchy, rename each one (names have to be unique for the Group's variations) and drag a new audio clip (if necessary) into each. That would at least copy all your settings though.
     
  28. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Sorry my english is not the best :)

    I have about 20 sounds in one group and I want to play them randomly, not in sequence, and with a min/max interval between them. Some sounds could be longer that the min interval. In that case I need to start anyway the new sound over the previous one without to stop it.
    Maybe with source code I can explain better:
    Code (CSharp):
    1. IEnumerator PlayRandomSounds() {
    2.     while(true) {
    3.         var secs = UnityEngine.Random.Range(0.2f, 4f);
    4.         yield return new WaitForSeconds(secs);
    5.         MasterAudio.PlaySound("Birds");
    6.     }
    7. }
    Here the group is set with Variation Sequence: Randomized

    Thank you for all other points :)
     
  29. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    Hi, thanks for picking it up.

    I use clip pitch and volume to fine tune how things sound. Maybe this is the wrong way to do it?
    With ChangeBusPitch every clip in that Bus gets that pitch i set, so variations and individual settings are lost.

    The functionality i'd like to have would be setting the value relative to to the individual clip pitch (I think BusVolume might work this way) like this.
    "MyBus" contains{
    ClipA Pitch 0.6
    ClipB Pitch 1.1
    ClipC Pitch 1.0
    }
    ChangeBusPitchRel("MyBus", 0.5f) will result in these settings
    ClipA Pitch 0.3
    ClipB Pitch 0.55
    ClipC Pitch 0.5
    and back to 1 ChangeBusPitchRel("MyBus", 1f) will have the original settings as result

    But i'm not an audio guy and i'd might just got the wrong idea how those things work. Here is what i try to archive.
    As mentioned above i have various individual pitch/volume settings and variations and some of them are altered during runtime (like a car engine). Now, for a bullettime effect i want to sound everything slower (pitch down). But, for instance the car engine clip get's the 1f pitch if i come back from bullet time with ChangeBusPitch("MyBus", 1f) and not the value it had before bullet time. So this is how i came to the idea to set the pitch relative and not absolute. I cant check right now, but the volume settings might work like what i have in mind.
     
  30. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Well I can't think of a good way to achieve that aside from writing code as you have. I would change your MasterAudio.PlaySound to MasterAudio.PlaySoundAndForget so it doesn't return an object, that will save on garbage collection.
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I took a stab at it, but this one I'm unable to add at this time. What happens is that the original pitch of each clip would be lost the first time you use ChangeBusPitchRel. What that means is that you couldn't use a factor of 1 to get it back to normal. If you first called it with a factor of 0.5, then to get it back to normal you would need to call it with a factor of 2. The original pitch needs to stay at the original value or it's not of much use. Sorry about that.
     
  32. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    I'm having an issue on my game where I setup a prefab with a event sound script and a sound attached to it. I am having the master audio prefab loaded in my persistent game object and not just sitting in every level. So what I think is happening is that a member on my team changes the prefab in a level that's not the persistent game object level and the prefab loses the sound group which it previously had. I think I've replaced the sounds on all my prefabs 2 or 3 times now, and I was wondering if you had any solution to this issue as I can't be the only one using a loading level for persistent game objects.
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    View attachment 109917
    You'll need to figure out exactly what's happening, because I can tell you that the Sound Groups that the Event Sounds component configured to play are stored as strings. If there's no match in a Master Audio prefab in the Scene, it still displays as a string but no dropdown. I don't know how it's possible to lose the string unless the prefab with the Event Sounds component is modified directly. You can look in debug mode (at the top-right Inspector next to lock icon) to tell what's going on. Here's a screen shot of mine. But be careful and don't change anything in that mode.

    Capture.PNG
    We use a persistent MA prefab all the time and haven't had any issues.
     
    Last edited: Aug 19, 2014
  34. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Thank you for the suggestion about GC.
    Anyway my idea was to add this interval of min/max time in the settings of the randomize mode.
    Of course is just my point of view, but if you offer a random system, some more option would make it more flexible. In some way I spent more time trying to see if it was already supported from Master Audio then coding it.

    Thanks
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I agree. Maybe I'll include a version of your script above as a script to use in a future version.
    Thanks.
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Great news! I've added a new script to perform Update methods (every frame) on every actively played Variation. The script is only active while it's needed, so you don't waste cycles unnecessarily. 2 of the large CoRoutines from SoundGroupVariation have been moved into there and are no longer CoRoutines, so our garbage collection allocation is down to a super low 60 bytes per sound play!

    As soon as I test it some more, I'll put out an update including this. There's a button on Master Audio Manager to upgrade all your Variations at once with the new script.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I've taken it even further. Down from 60 bytes to 16 bytes per sound play! And the Event Sounds taking 1.1kb was only the first time, it needed to be pre-warmed. All calls after the first take the same as a normal sound play. Now I've added pre-warming code to Event Sounds and other areas as well. Performance should be rock solid and ridiculously faster than before (not to mention clobbering our competitors' benchmarks mentioned on the previous page)! New version coming up.
     
    Last edited: Aug 20, 2014
  38. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio v3.5.5 will be live in 20 minutes. This is a big one! And notice that you'll need to upgrade your Master Audio prefabs with a button (about half way down). Changelog:

    • Added Change Bus Pitch to Event Sounds.
    • Added ability to remove last song in any Playlist. There's now an "Add Empty Song" button above that to get it back without dragging a song in.
    • New Playlists no longer get created with an empty first song. Zero songs instead.
    • Added ability to remove last Playlist in Master Audio prefab.
    • Changed a bunch of green notes in Inspectors to the red error bar and yellow attention bar when better suited.
    • Added a section in the Sound Group's Inspector to copy various settings from one Variation to all others to save time (custom fade, random delay, random pitch, random volume, etc);
    • Added a section in the Dynamic Sound Group's Inspector to copy various settings from one Variation to all others to save time (custom fade, random delay, random pitch, random volume, etc);
    • Fixed bug: playing the same song as is already playing will stop it playing after shortly after loading if it's a resource. Now we ignore requests to play the currently playing songs and log a warning so you know it happened.
    • Fixed bug: Clip Age Prioritization was not checking whether you turned it on or not, assumed on always.
    • Added new script SoundGroupVariationUpdater to all Variations (disabled for now). When I'm done with it, it will be activated when you need follow code or other CPU-intensive code, but will be disabled any other time. This should allow me to get rid of most or all of the CoRoutines.
    • Note: For the above bullet, to upgrade your Master Audio prefabs, you will need to open the Master Audio Manager window and click "Upgrade MA Prefab" for each Scene with a MA prefab. It will fix the Variations. If you forget, the Console will tell you this info.
    • Moved following and priority updating code into SoundGroupVariationUpdater script, eliminating one CoRoutine.
    • Moved DetectedSoundEnd code into SoundGroupVariationUpdater script, eliminating another CoRoutine. Allocations now down to 60 bytes per sound play!
    • Added ClearQueue method to PlaylistController.
    • In play mode, each bus now has a stop button which stops all actively playing audio that's going through that bus.
    • Added pre-warming code to each in-Scene Audio Clip to prevent lags when using them for the first time.
    • Added pre-warming code to EventSounds which works if you have any object that start in the Scene with that component, to prevent lags when using them for the first time.
    • Refactored SoundGroupVariation to reuse its object to take Allocation from 60 bytes down to an insanely low 16 bytes per sound play!
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Correction, allocation is actually now zero bytes with PlaySound "AndForget" methods. 16 bytes is used if you need the return object (EventSounds always uses that).
     
    Binary42 likes this.
  40. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    How do I fix the error Assets/TK2DROOT/tk2dUI/Editor/Controls/tk2dUISoundItemEditor.cs(95,52): error CS1501: No overload for method `RecordObjectPropertyForUndo' takes `2' arguments?

    Also I tried to recreate the prefab issue and it must be something else, I'll keep looking into it.
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I believe I fixed that. Can you delete that file (tk2dUISoundItemEditor.cs) and re-import the Master Audio 2D Toolkit package again and see if it goes away?
     
  42. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    Yea that fixed it thanks.
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Excellent wightwhale.
     
  44. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    940
    I have a very specific use case and I'd like to know if MasterAudio could help me out. Here it goes:

    I need to be able to play audio files and know exactly at which point they started, paused and ended. This is because I have a text that will be highlighting the words as the audio plays. For this I have a "Label Track" created in Audacity that I read and show the text accordingly.

    The biggest issue is that these audio files will be coming from Asset Bundles so I can't really add them to the MasterAudio in advance.

    Can MasterAudio help me in this case? How?
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No, there is no Asset Bundle support currently. Although it is on the list of things to add. Probably months away from getting the time to do that one though. There are several more important things ahead of it.

    There is functionality built in to know when audio ends and when it starts it pretty much when you tell it to play.
     
  46. mbreitkreutz

    mbreitkreutz

    Joined:
    Dec 4, 2013
    Posts:
    23
    All of our audio files are in AssetBundles. We don't put any audio references in the MasterAudio prefab. Instead, we have prefabs containing a DynamicSoundGroupCreator that contain the audio files (in Sound Groups). We have several of these prefabs for grouping related audio files. At runtime, we use the DynamicSoundGroupCreator to load the audio file on demand before playing. To make this work, we have to know which prefab the audio is in when it is told to play and if this prefab hasn't been referenced before, DynamicSoundGroupCreator.PopulateGroupData has to be called (I had to make this function public). Then MasterAudio.CreateNewSoundGroup is called for the requested audio before PlaySound* is called. We don't remove any of these groups until the scene changes under the assumption that the audio may be needed again in the same scene.
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Awesome! I wonder if you might share the code you used to do that with me? It might help me to add AssetBundle support.
     
  48. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Update: we've downloaded beta Unity 5.0 and got Master Audio totally working under the new rebuilt audio engine! So there will be zero downtime when 5.0 comes out, and it's still backward compatible. We will need to change the Master Audio Clip Manager a little since import settings have changed and hopefully add some no-coding mixer automation :)

    Carry on!
     
    Last edited: Aug 22, 2014
  49. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    A similar feature that I need is to know the time of the music in the moment that I stop it (or fade it out), and to play the same music again, later, from the same time. This is needed to don't have the music of the main menu restarting every time from the beginning when I come back from the in-game scene.
    Also a random starting point could be interesting. But having a method to start a sound from a specific time I could just choose by code a random time.
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There's a Song Transition Mode called "Last Known Position" which will automatically start a song where it left off before it played another song. Just select it on the Playlist. No code needed if it's in the same Playlist.