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

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Hi! If I create sound like this:

    MasterAudio.PlaySound3DAndForget("MeteorFallingLoop",meteorShowerPrefab.transform,true);

    I do not have reference to it. But sounds is looping. And I want to stop it, once the object it is attached to, gets destroyed. Is there a way to get reference to this sounds and stop it when I need to?
     
  2. mbreitkreutz

    mbreitkreutz

    Joined:
    Dec 4, 2013
    Posts:
    23
    Call MasterAudio.PlaySound3DFollowTransform instead and use the return the value to hold on to the played sound.
     
  3. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Thanks! Actually, I've just founded 'StopSoundGroupOfTransform' inside API, and maybe that was the one I was looking for.
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yes, that works. Or it you are ok with stopping all of that sound, then it's MasterAudio.StopAllOfSound();
     
  5. moopi

    moopi

    Joined:
    Apr 24, 2012
    Posts:
    39

    Changing INNER_LOOP_CHECK_INTERVAL to 0.01f improved the quality a bit, but it's still not as good as with Unity native audio. The clip I'm using is normal 16bit, 48KHz stereo wav, set as 3D sound and loaded in memory.

    For the Mike's suggestion, I have no idea what I have to do to test it (should I put something in some script to get id with GetInstanceID and then use some other method to set it for MasterAudio as a ListenerID? Any example?)

    Br,

    - Moopi
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Mike can answer that question, but your suggested code sounds correct. He actually sent me the code for a specific scenario his game had and I just put it in. As far as it being "not as good as with Unity native audio" - Master Audio uses Unity native audio. It's just an Audio Source with an Audio Clip in it under the covers. We haven't encountered this issue ourselves. Do you have a project you could send us to reproduce the issue?
     
  7. mbreitkreutz

    mbreitkreutz

    Joined:
    Dec 4, 2013
    Posts:
    23
    If you want to try this, in the Awake or Start script for your player game object, just add MasterAudio.ListenerID = gameObject.transform.root.GetInstanceID(); Alternately, you could use the transform/instanceID of your main camera. I don't know if it will work for you or not based on your example. It was a problem in our game because we have the listener attached to the player in the world so I had to tell MasterAudio to update the playing sound and the listener in sync.
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Right, thanks Mike!
     
  9. jerotas

    jerotas

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

    • Fixed bug where short Playlist songs of "from beginning of new song" Song Transition Type would sometimes not start at the beginning.
    • Fixed bug where playing a queued song in a Playlist would lose track of which songs were played and cause the wrong song to play afterward.
    • Fixed bug where triggering a song in a Playlist would lose track of which songs were played and cause the wrong song to play afterward.
    • Fixed bug where top-to-bottom setting with "refill after inactive time" could cause erorrs and sounds not playing if any Variations weren't played when it refilled.
     
  10. atmospherium

    atmospherium

    Joined:
    May 12, 2013
    Posts:
    38
    Thanks jerotas, that basically sums it up. One thing to add - both the free and the paid package include a new, simplified version of the Delay component (the paid version still contains the original, more fully-featured version as well). SimpleDelay doesn't feature the panning options, but allows for you to measure delay-time in milliseconds instead of beats per minute. The goal was to make it as quick and easy to use as possible.
     
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That's cool, thanks for the clarification.
     
  12. cloudcamaleoniv

    cloudcamaleoniv

    Joined:
    May 17, 2013
    Posts:
    57
    One more Time.timeScale = 0 problem

    When the user presses the pause button, my game controller class makes the Time.timeScale = 0

    The problem is: Just after the user pauses it, all of the sounds that were attached to a gameObject are being detached.


    In summary, I make the time.timeScale = 0, all of the attached sounds (played with PlaySound3DFollowTransform) are being detached from their gameObjects.

    Do you know what may be causing this strange behaviour?
     
    Last edited: May 18, 2014
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    They aren't really ever attached, they just follow. They always remain in the hierarchy under the Master Audio prefab. So I don't understand the problem exactly. What do you mean by "they are being detached"?
     
  14. cloudcamaleoniv

    cloudcamaleoniv

    Joined:
    May 17, 2013
    Posts:
    57
    Sorry, what I meant is that they stop following the gameObject when I put timeScale = 0
     
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    So you actually have things that move during zero timescale? Seems weird to me. Please clarify.
     
  16. cloudcamaleoniv

    cloudcamaleoniv

    Joined:
    May 17, 2013
    Posts:
    57
    Okay, sorry again for the really bad explanation. English is not my native language, I mess things up quite a bit.

    What I meant is that I execute PlaySound3DFollowTransform, and the sound is following my desired game object just fine. But when I pause the game (timescale = 0) and then I unpause it (timescale = 1), the sound is not following the game object anymore.

    And that's it.
     
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, got it. I'll see if I can reproduce the error and fix it. Thanks!
     
  18. cloudcamaleoniv

    cloudcamaleoniv

    Joined:
    May 17, 2013
    Posts:
    57
    There's one more detail that might influence your tests. The pause mechanic is executed along with MasterAudio.PauseBus("busName") and the unpause mechanic execute the MasterAudio.UnpauseBus("busName"). And the sound that stops following the game object belong to that bus.
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, thank you for that info.
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yeah, it's the PauseBus command that causes this behavior. What actually happens is that when you "unpause" a sound, it does nothing but play the clip. All the other CoRoutines have ended as a side effect of the pause (for following / fading / etc). So if you need to follow the Transform again after a pause, you'll need to play the sound again the normal way. - don't use Unpause. I took a look at the code and there doesn't seem to be a good way to fix this without causing other bugs.
     
    Last edited: May 21, 2014
  21. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    I just imported MasterAudio, clicked scan project for sfx, and now my Unity Editor freezes completely every time I open audio clip manager. I have 10k sfx in my project, I realize this is a lot - they come from imported sfx packs from assets store, but one of the main reasons I bought this is to be able to batch edit my audio clips, and that fetaure is useless when Editor is completely frozen.
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yes that would be useless. I've tested with about 1,000 clips and it was still responsive. I'll take a look with more.
     
    Last edited: May 24, 2014
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, fixed the issue! Master Audio V3.5.3.7 will be live in 20 minutes. Changelog:

    • Fixed bug where a warning would be shown every 2 seconds if you have no playlist assigned to a Playlist Controller.
    • Made ActiveAudioSource property in PlaylistController a public property.
    • Fixed Clip Manager window to work with thousands of clips. Added paging.
     
  24. hexdump

    hexdump

    Joined:
    Dec 29, 2008
    Posts:
    443
    Hi!,

    I have some problems with Master Audio:

    1) SFX in my game are played on Desktop but not on mobile (android)
    2) I need to remove the number of sounds of the same kind that can be played at the same time (by default just one)

    Thanks in advance.
     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    We have used this in an Android game and had zero problems, as have many of our customers. You might try turning on "log all sounds" and reading the ADB Logcat logs and see what it being logged by Master Audio on the Android device. That's the only way I know to troubleshoot Android builds. I have no idea what could be going on though :|

    I'm not sure what you mean by "remove the number of sounds of the same kind that can be played at the same time". Do you want play more than 1 at a time? Use the weight property to adjust that, which defaults to 1 for each Sound Group Variation.
     
    Last edited: May 24, 2014
  26. jerotas

    jerotas

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

    • Note: this setting will need to be turned on if you require Timescale zero code to work. Added "ignore time scale" option in Master Audio advanced section. Defaults to off. Performance and garbage collection on lower-end devices can suffer some for turning this on, so only use it if you need to.
    • Added "start time (seconds) to Playlist songs. Defaults to zero. Only available in Song Transition Mode "new song from beginning".
     
  27. kreischweide

    kreischweide

    Joined:
    Jan 2, 2013
    Posts:
    7
    Hi,

    I've just encountered a very strange bug in the latest version of the MasterAudio asset:

    I'm using a Audio Group "Fire" with a 0.4s short wav clip and set it to a weight of 12. Then I choose Replay Limit Mode "Time Based" and 0.1s. Triggering this will just do nothing or sometimes effects between 1-3s. Looking at the code I see that you used Time.realtimeSinceStartup for capturing the last trigger time, but compare it to Time.time for the replay. There seems to be a strange difference between them. If I change

    _group._lastTimePlayed = Time.realtimeSinceStartup;

    to

    _group._lastTimePlayed = Time.time;

    the replay mode works just fine. Maybe its my machine, just checking with you :)
     
  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Good catch, I'll make the change, that makes sense! Although I'm going to go with "realitimeSinceStartup" for all instances. That makes more sense for persistant mode MA.
     
    Last edited: May 26, 2014
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Heads up, we will be moving our default folder into the Plugins folder so that JavaScript users won't need to move things.
     
  30. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Updated to Unity4.5 and getting a ton of Master Audio errors with the playmaker actions. My playmaker is up to date...
    Examples:

    Assets/DarkTonic/MasterAudio/PlaymakerCustomActions/MasterAudioBusFade.cs(5,2): error CS0246: The type or namespace name `Tooltip' could not be found. Are you missing a using directive or an assembly reference?

    Assets/DarkTonic/MasterAudio/PlaymakerCustomActions/MasterAudioBusFade.cs(5,2): error CS0104: `TooltipAttribute' is an ambiguous reference between `UnityEngine.TooltipAttribute' and `HutongGames.PlayMaker.TooltipAttribute'
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you for reporting this, I hadn't upgraded yet. I'll download Unity 4.5 and get this fixed ASAP.
     
  32. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Negative, sir. I've installed Unity 4.5, the newest Playmaker and a fresh copy of Master Audio with the Playmaker actions. I get zero errors in the console. I believe you don't have the very newest versions of the MA Playmaker actions. Please delete the Master/PlaymakerCustomActions folder and open the MA_PlaymakerActionsAndScene package again. Pretty sure those errors will go away.
     
  34. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Ok thanks, i'll try that tomorrow
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No problem.
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    False alarm, actually we're not going to move the plugin into the "Plugins" folder. It causes other problems with DF-GUI for example when you install the optional package for it. I would like to move it, but it's not worth the trouble for the smaller amount of JavaScript users unfortunately :(
     
  37. jerotas

    jerotas

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

    • Fixed inconsistency with time retrigger limit in Sound Groups. It was using different time variables. Now they're all the same.
    • Huge increases to performance of AudioUpdater (optional component).
     
  38. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    SNIP.


    Nevermind, the DLL was compiled for .NET 4 and for some reason my own code never triggered the compiler error (but Master Audio did). Recompiled the DLL for 3.5, now it seems to work.
     
    Last edited: Jun 2, 2014
  39. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    138
    Are any Master Audio users still on Unity 3.5.7?

    If so, why haven't you upgraded?
     
  40. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    138
    I'll take the silence as a good sign :)
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I think we're about to reverse our music advice in the ReadMe. At least within the Unity editor, using multiple streaming audio clips in a Playlist seems to take up large chunks of memory for each clip (even when they're not playing). I'm not sure if this is true on target devices (iPad etc) and there are known Profiler bugs with the Unity audio profiler. However, setting up all songs as Resources and non-streaming (streaming doesn't work with Resources anyway) should save you quite a bit of RAM if you have more than a couple songs in your playlist.

    If anyone can run profiler (not on Unity 4.5 - see below) on a target device and let me know if it's still true there, it would be appreciated. My profiler never connects to my iPad for some reason.
     
    Last edited: Jun 6, 2014
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Also take note that the Unity 4.5 Profiler audio section is pure crap. It reports 200 Audio Sources and 54.6 Mb Audio memory usage on a test scene with 1 Audio Source whose clip is 0.1 Mb. So don't believe anything it says. I'm going to file a bug report this evening.
     
  43. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    I bought this a few months back, the few times I got to use it, I always get errors I get them before I even get to use it.. Which always is 95 errors

    757 Default parameter specifers no permitted.
    there are ton of others with the same error events sound script and Master Audio

    I'm using 4.5 and everything is updated.

    AS I said I had similar errors before, have a project due tomorrow for school, so I love to use this asset but I get to many errors before I can even use it.... All the time.. Please let me know what I CAN, do.

    Thanks
     

    Attached Files:

  44. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I don't know what that attachment is supposed to show me. It's not useful. Can you paste a couple of the errors into the thread here so I can get an idea? We haven't had any reports of what you're saying. Have you tried deleting the entire DarkTonic and Master Audio folders and re-importing from the Asset Store?
     
  45. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    I updated to 4.5 and then updated the asset and playmaker package, thanks! that fixed all the errors, except I'm getting this one.
    Any ideas?

    Assets/DarkTonic/MasterAudio/Scripts/Settings/DynamicSoundGroupVariation.cs(14,36): error CS0426: The nested type `AudioLocation' does not exist in the type `SoundGroupVariation'
     
  46. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Well you somehow have a (maybe older) version of DynamicSoundGroupVariation. Indeed AudioLocation is not in SoundGroupVariation but in MasterAudio.cs.

    I think you'll need to delete your entire DarkTonic & MasterAudio folders and reimport the latest from the Asset Store.
     
  47. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    ok thanks, I'll try that
     
  48. jerotas

    jerotas

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

    • Please delete and re-add any playlist songs that have Resource files. Fixed bug where creating Resource file playlist songs keeps the clip reference. This would use extra memory unneccessarily.
    • Fixed bug where selecting folder filter in Clip Manager showed items in subfolders.
    • Fixed bug where dragging Resource clips into playlist makes you do it twice for each song.
    • Fixed bug where dragging multiple Resource clips misses adding some to the playlist.
    • Added ChangeVariationVolume method to compliment the existing ChangeVariationPitch method.
     
  49. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Just installed your plugin, it looks great!

    Couple of questions:

    1 - can you do crossfading between scenes?
    2 - in my screenshot, is that the correct way to set up a background sfx?
    3 - in this same game object in the screenshot, I plan to add a variation to the sfx, but this variation is based upon a condition being met, so is the 'Variation Mode the correct way to do it?

    Thanks

    Screen Shot 2014-06-08 at 9.33.49 PM.png
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    1) Yes you can crossfade the playlist during a scene transition, but you'd probably need to write 1 line of code to do it since there's no "scene exiting" event for us to do it code-less. Or you could try using the Disable event on any GameObject that only gets destroyed when the scene ends.
    2) Yes that's correct, unless you want to play a non-random variation of that Sound Group. If so then enter the name of the Variation there as well.
    3) If it's a condition other than a certain layer collision or trigger, then you'll need to write your own 1 line of code to play the sound based on your logic. No, variation modes are not for that. You should keep it at "normal" if you're not wanting the specific behavior of Looped Chain or Dialog as decribed in the read me.