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
    Most likely. If you have Unity pro, you can use Async resource loading which is even smoother loading.
     
  2. timothyallan

    timothyallan

    Joined:
    May 22, 2013
    Posts:
    72
    Is there a way to get the length of the sound about to be played?
    For example, I would love to be able to do this pseudocode:

    PlaySoundResult result = MasterAudio.PlaySound("03 Title Track");
    Invoke ("CoolEffect", result.SoundLength - 10.0f);

    Which would fire off an event 10 seconds before the clip is about to finish without having to hardcode the length of my audio clip... which can change.
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sure, try this:

    Code (csharp):
    1.  
    2.  PlaySoundResult result = MasterAudio.PlaySound("03 Title Track");
    3.  if(result.ActingVariation != null) { // actually played, not stopped by bus limits or other MA limts.
    4.      var clip = result.ActingVariation.audio;
    5.      var length = clip.audio.length / clip.pitch; // need to divide by pitch to get the true play time.
    6.      // call Invoke here with length variable.
    7.  }
    8.  
    Should I add a property to ActingVariation for this to it does the calculation for you?
     
  4. timothyallan

    timothyallan

    Joined:
    May 22, 2013
    Posts:
    72
    Ahhh that'll do it. Thanks!
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Any time, timothyallan.
     
  6. maxxa05

    maxxa05

    Joined:
    Nov 17, 2012
    Posts:
    186
    I purchased your system some time ago and I never used it before, but now I came to a situation where I need to play music tracks sequentially and I thought your system may be able to help me. Basically, I've got a start clip, a looping clip and an ending clip. I would like the start and loop tracks to play in order, seamlessly. Furthermore, I have several moments in my loop track where I can branch into the ending track, and I would like to start the transition at the closest moment in the track when I ask for a transition by code. So, basically: Start -> Loop Endlessly (when asked to go to the end, find the closest branching moment) -> End.

    I can do the code finding when I've got to branch, but I need this system for the seamless transition part. I succeeded to make a playlist with MasterAudio and make all 3 tracks play sequentially, but for some reason the music volume change after each transition. That, and I have no idea how to make a clip loop, then transition to another clip when I need it.
     
  7. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Are you using the Playlists for this, or are you doing it in a Sound Group? Do you need crossfading or not? Only the Playlist Controller has crossfading. I can't answer your question until I know more.

    We do have the option of gapless transitions on Playlists, but that doesn't sound quite like what you want.
     
  8. maxxa05

    maxxa05

    Joined:
    Nov 17, 2012
    Posts:
    186
    Yeah, I made a playlist with the 3 tracks. The music started at full volume, then the second track played quieter, then the last track played at full volume. So I would like to be able to play all those tracks at the same volume, with the second track playing in a loop, until I ask to transition to the last track. Crossfades are fine if it does not mess too much with the tracks timings.
     
  9. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Have you not marked your audio clips as 2d? That's the only thing I know of that could mess with the track volumes and make it act that way.

    For each track you want to loop, tick the Loop Clip checkbox in that song's settings inside the Playlist. Then it will loop until you tell it to advance.
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V 3.5.6.4 will be live in 20 minutes. Real-time mixing that can persist after you press stop is here! Bulk group operations in the mixer are also here! Changelog:

    • Removed accidental log statement in ResourceOptimizer.
    • Fixed bug where turning on Clip Age Priority would cause Null Exception error to be logged in Console if playing a sound in "Caller Location".
    • Fixed bug where the PlaylistVolume property of Playlist Controller didn't update the volume of the currently playing clip.
    • Fixed almost invisible Delete icon for Event Sounds listening to Custom Events.
    • Added Footstep Sounds script, which is a much simpler and focused version of EventSounds. You select trigger or collision event (once only), then tell it what Sound Groups to play to which layer / tags.
    • Added button "Alpha Sort Custom Event Triggers" to Event Sounds in the top section. It will make all Custom Event Triggers sorted A-Z by Custom Event name.
    • Added ability to save all changes made during runtime! New checkbox in Advanced Settings section defaults to off: "Save Runtime Changes". Saves all changes to Master Audio prefab (mixer too), Groups, and Playlist Controllers.
    • Added "Expand / Collapse Group Creation" button in the mixer section, to give you more screen real estate at time you don't need that part.
    • Added "Bulk Group Changes" checkbox above the mixer. Turning this on puts a checkbox at the left of each Group in the mixer. There are select / deselect all buttons next to that. You can select X Groups in the mixer, then mute / solo / adjust volume or change bus in bulk for the selected Groups only.
     
    Last edited: Nov 9, 2014
  11. Cargh

    Cargh

    Joined:
    May 17, 2011
    Posts:
    36
    I have yet to really delve into working with audio, so my knowledge is almost nil. Maybe you could tell me why I would need your asset in Unity 5, considering the significant improvements to audio in 5.0. In what way does Master Audio extend unity 5.0 default audio solution?
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The short answer is "quite a bit".

    For the long answer, take a look here in our support forum where I elaborate: http://darktonic.freeforums.net/thread/130/unity-5-audio-master-why
     
  13. Cargh

    Cargh

    Joined:
    May 17, 2011
    Posts:
    36
    Thanks jerotas. I will be going ahead with my purchase then.
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you sir, you will not be disappointed!
     
  15. timothyallan

    timothyallan

    Joined:
    May 22, 2013
    Posts:
    72
    Hi again :)

    I need a way to unsubscribe from multiple SoundFinished events. What's happening is that I have a bunch of sounds which are playing, which in turn are subscribed to the SoundFinished event. They all do something different when the sound ends... unless the level changes at any time.

    When I do a level reload/change, MA fires off the events to functions which are now in destroyed objects. I -could- keep a reference to each of my audio clips and then manually unsubscribe from the event using -= in OnDestroy or something, but it would be much easier if there was a bulk way to UnsubscribeAll for SoundGroupVariation.SoundFinished.

    Make sense?
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Actually I believe you can already do that with native .NET code like this:

    Code (csharp):
    1.  
    2. var result = MasterAudio.PlaySound("X");
    3. if (result.ActingVariation != null) {
    4.     result.ActingVariation.SoundFinished = null;
    5. }
    6.  
     
  17. timothyallan

    timothyallan

    Joined:
    May 22, 2013
    Posts:
    72
    yep, but that way I need to keep tabs on every single sound that I'm currently playing and loop through them to unsubscribe.
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Are you saying you want to Unsubscribe from all Variations with a single call?
     
  19. timothyallan

    timothyallan

    Joined:
    May 22, 2013
    Posts:
    72
    Yes, I could have a dozen or so sounds playing that are all subscribed to that event. I don't have currently have references to them to unsubscribe them via .Net.
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, I'll add that.
     
  21. timothyallan

    timothyallan

    Joined:
    May 22, 2013
    Posts:
    72
    Awesome. Love your work :)
     
  22. Teku-Studios

    Teku-Studios

    Joined:
    Sep 29, 2012
    Posts:
    257
    I cannot import the new version of MasterAudio. When I try to do so, the Import process fails and throws an exception ("Single Variation 5 Voices prefab is already created"), then crashes and aborts the process.

    I'm using Unity 4.3.3f1, could that be the source of this problem? We're really interested on the Save Runtime Changes option.
     
    Last edited: Nov 10, 2014
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You'll need to delete the GroupTemplates folder and then re-import. It's located at: Assets\DarkTonic\MasterAudio\Sources\Prefabs\GroupTemplates
     
  24. Teku-Studios

    Teku-Studios

    Joined:
    Sep 29, 2012
    Posts:
    257
    That worked. Thanks!
     
  25. HaroldBalls

    HaroldBalls

    Joined:
    Oct 30, 2012
    Posts:
    20
    Hey Jerotas, I just updated to the latest version (I rolled back a few weeks ago for a demo) and am now getting sounds playing really late....so even though a death sound might be triggered on the first frame of the death animation, its playing well after the animation is complete..

    you mentioned earlier that you had a fix for this issue, would have that if i got the latest from the asset store this morning?
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That's not ringing any bells for me. It's worth a shot, but I don't remember even hearing about this issue before. Can you refresh my memory? I'm not sure how you have it set up to play the sound for an animation.
     
  27. HaroldBalls

    HaroldBalls

    Joined:
    Oct 30, 2012
    Posts:
    20

    Basically all of my sounds are resource files, and their variation mode is clip. in general game-play, many can be called per frame. Since upgrading, most sounds play very late. long after the call was made to play them.

    The example I used wasn't specific to an animation, just to illustrate how late sounds were playing. all of my sound is played through master audio calls.

    pretty much all i do is use play3dSoundAtTransform() of playsound() all over the place. and all it takes is for me to upgrade to the newest version, and all sounds are kinda busted. they all seem to play really late
     
    Last edited: Nov 11, 2014
  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If your Variation's "Audio Origin" is Audio Clip, it doesn't matter if the file is in a folder called Resources, it won't be treated as a Resource file. It will occupy memory all the time and be ready to play instantly.

    If your Audio Origin is Resource file, then it will have to be loaded into memory before it can be played, which naturally causes a delay. The delay may be as small as 1 frame's time if you have have Load Resources Async turned off (but it blocks the thread until loading it done), or could be 6 or more frames delay using Async load. The delay will be longer the larger the Resource file is, and loading multiple Resource files at the same time isn't going to make it any quicker of a delay, more than likely it will increase the delay.

    Do you have Audio Origin set to Resource for all SFX? That's generally an anti-best practice and for sure would lead to a lot of noticeable delays, especially if you're loading multiple clips at the same time.

    Pretty sure that there was no code added in recent updates that would increase the delay, especially since I wouldn't know how to do that if I wanted to. It must be a coincidence that it happened when you updated.

    And still, I don't remember hearing about this issue before, sorry. No one else has reported it either.
     
  29. HaroldBalls

    HaroldBalls

    Joined:
    Oct 30, 2012
    Posts:
    20

    I mentioned it on page 38 of this thread...Most of the audio's audio origin is set to "resource", and in the last version i had (3.5.0? ish) everything worked fine, I would love for the delay to be a few frames, currently the delay is sometimes around a second, the game basically doesn't work.

    if the variation more is set to "clip" does that mean that the sound will remain in memory after loaded? because I'm seeing the delays even after the sound has been played once
     
  30. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The fix I posted on p38 is in the newest version yes. Other than that I can't reproduce anything like you're seeing. My Resource files seem to load near instantly with no detectable delay.

    How many Resource files might be loading at the same? You'll likely need to send me something to reproduce this but I would suggest not using so many Resource files and I suspect that it's simply from that. Especially if they're very large. Are you saying it delays 1 second on your computer, or on a device you're deploying to?
     
  31. HaroldBalls

    HaroldBalls

    Joined:
    Oct 30, 2012
    Posts:
    20
    my game has a large number of items that can be used in the game, but the player can only equip 6 of them, so overall, there are a lot of items using resource files, but the number being loaded every frame is probably not crazy high, and I am able to reproduce the error with a really small number of sounds,.

    Also, the version that I don't see the problem is 3.5.4.7....all i need to do is swap with the latest version to either introduce or get rid of the problem
     
  32. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That doesn't matter, it doesn't help me. The only thing that will help me help you is for me to be able to reproduce it on my machine first and then fix it. So please either send me something that reproduces it, or tell me how to reproduce it.

    Still, loading a few sounds a frame for a few frames sounds to me like it could make something like that happen.

    -Brian
     
  33. HaroldBalls

    HaroldBalls

    Joined:
    Oct 30, 2012
    Posts:
    20
    I'll do that next week when things calm down here, there weren't any features I was looking for in the latest version, I just wanted to be on the latest. So for now, ill be rolling back a second time!
     
  34. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok. Sorry I can't really do anything to help your situation, but it's not happening over here.
     
  35. djfrail

    djfrail

    Joined:
    Jan 16, 2014
    Posts:
    124
    I'm getting a weird music volume bug. I can recreate the problem by:
    • creating a new project
    • importing the latest Master Audio version from the asset store
    • go to window/Master Audio Manager and click create for Master Audio Prefab and Playlist Controller Prefab
    • add new playlist
    • add a sound clip to the playlist - I used "blast" from the Dark Tonic examples
    • add another sound clip to the playlist - I used "blast" again
    • set playlist controller to initial playlist to the one you just created
    • click on the PlaylistController in the hierarchy, turn off Loop Playlists, leave on Start Playlist on Awake and Auto Advance Clips
    • click on the MasterAudio in the heirarchy, set master crossfade time to zero
    • Press Play in the Unity Editor
    You should hear two blast sounds play, but the second one is at a lower volume than the first. That's the weird bug - the second blast should be at the same volume as the first.

    Interestingly, if I use the mp3 clip "King" as the two sound clips above instead of the "blast" sound clip, it works as expected, with both sound clips being played at the same volume.

    I ran into this problem in my game when I changed to a new song in a playlist, so then I tried out this little test.

    Anybody else seeing this problem?
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'll take a look this evening and report back. Thank you for the detailed repro steps.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    This error occurs because it looks like the custom rolloff curves of the 2 Audio Sources in Playlist Controller are not the same. I always advise to use only 2d clips for music so we've never known this. I'll fix this for the next version. However, even when the update is released, existing projects will need to destroy and recreate any existing Playlist Controllers to "get" the template corrections.

    If you play music with only 2D clips, this is not an issue.
     
    Last edited: Nov 12, 2014
  38. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Super simple solution and :oops: yes, I should have read "what the log message says."

    Thanks again!


     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Cool, let me know if that doesn't solve your problem :)
     
  40. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    How to repeat a sound in a short time? I want to play a blade sound over 10 times in a second, but MasterAudio.PlaySound() play the sequence one by one. Thank you
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Maybe you should use the Chained Loop? That will play all Variations in the Group in random order with no pause between.
     
  42. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    What a quick reply! :) That seems what I am looking for, thanks!
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Awesome :)
     
  44. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Limited time $30 sale starts now!
     
  45. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    set to caller or caller location not working. it doesnt matter how far I am from the caller, i can hear the sound from any distance.

    Unity 5 beta 13
     
    Last edited: Nov 17, 2014
  46. jtok4j

    jtok4j

    Joined:
    Dec 6, 2013
    Posts:
    322
    I was privileged enough to purchase this last month, and while not having used it extensively yet, I think it's really cool!
    Thanks for all the work you put into this! :)
     
  47. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    I'm having a problem with Unity Pro 4.5.5f1, Master Audio 3.5.6.4, on Windows 7 x64. Global muting of music playlist works at runtime, but not if saved in the scene.

    Master Audio is mostly working fine. However, during my debugging I want to turn all the sounds off, so I click the red 'M' mute buttons on the MasterAudio object in the scene. If I do it at runtime the mute works correctly. However, if I enable muting (for both "Master Mixer Volume" and "Master Playlist Volume") BEFORE starting the scene (and then obviously save the scene with both 'M' buttons lit and muting enabled), the muting of sound FX works as expected, however, playlist entries are NOT muted when my scripts play them.

    Clicking twice to re-enable, and then re-mute, during runtime, works.
     
  48. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Downloading the latest beta and will check this out tonight. Thank you for reporting the issue.
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You're welcome :)
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sorry, but I can't reproduce that on the Unity & MA version. And then I obviously can't fix it if it's not happening here. It may depend on some other setting? See if you can figure out how to get it to happen to an example Scene and let me know if so.