Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

[20% off!] 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,125
    I didn't clean up the Audio Sources in Dynamic SGC because it shouldn't matter, from what I know. Unity has a limit of 32 Audio Sources playing at the same time, but the ones in Dynamic SGC never play. Also, numerous references to the same Audio Clip doesn't take up additional audio memory. So I'm not sure there's a problem unless you have some new information?

    Filters though, even when not used, do take up audio memory. That's why I delete those during Start after copying them to the Master Audio prefab.
     
  2. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    I was able to reproduce. Very LOUD sound in example scene 1 when you shoot :)

    I'll be able to fix it on my end hopefully tomorrow. Thanks for the patch!
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    First of all, I'm not sure why there's even a checkbox for "auto-remove". I think you'd probably always want to leave that on. Yes if you're not sure you're going to need a group of sounds, put 1 or more Sound Groups into a Dynamic SGC that is not in the Scene (Project view), then spawn it once you are sure you need the sounds. They will get automatically destroyed going to the next Scene, so you'll need to instantiate them again on the next Scene if you need them again.

    Personally I'd do that as I'd hate to think about how to reliably manually remove the groups once I don't need them in all cases (game over, back to main menu, etc).

    I hope that helps!
     
  4. Konst

    Konst

    Joined:
    Aug 26, 2013
    Posts:
    78
    love this asset and working on my gui right now. Have a question

    Trying to change Master Playlist Volume via ingame GUI slider: So when i changing volume ingame i can see Master Playlist Volume is changing its value in Inspector but in fact volume is not changing, also while game is playing if i move my mouse into Inspector's master audio slider and hit it only once the music volume immidiatley changing to the new position value. So what is it i missed? Thanks!
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Show me the code you're using to change Master Playlist Volume. I'll bet it's not the right one. You're probably setting the public variable instead of the public Property. If you do that, the slider will move but the volume won't actually change. I wish I could make the variable non-public so we could avoid this confusion, but it has to be public so I can use it in our custom Inspector classes. Also check out the API here to see if it might clear up confusion.

    Glad you're enjoying the rest of the plugin. Thanks!
     
    Last edited: Jan 26, 2014
  6. Konst

    Konst

    Joined:
    Aug 26, 2013
    Posts:
    78
    Yep! You are right! fixed this ;) Thanks and have a good day!
     
  7. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    616
    Great! (no new information -- completely the opposite -- a lack of knowledge on my part :rolleyes: )
     
  8. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    495
    I've just installed this today and noticed that demo scene is not working properly. Music starts playing and the ship is there but enemies are not spawning. Demo scene is not incompatible with the latest unity?
     
  9. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    616
    Thanks for the reply (as always)!

    I wrote a huge response and realized it's too much. Instead, here are my main questions. I can post background info in another post if needed.

    1. Are active oldest sounds re-used on newer PlaySound*() automatically? Else how to configure?
    2. Is it best practise to put all audio under Master Audio? (are there cases when not to do this?)
    3. What's the best way to decide minimum "weighting (instances)"?
    E.g. 4 players, potentially same weapon, each that allows ~8 individual shots per sec, 2 variations each. Should one say 4 live shots each means 16 instances (split between the 2 variations)? (rather dependant upon (1))
    4. What are the limits for a single scene's MA/Audio on mobile? (e.g. don't exceed runtime 200 nodes of Variations under MA)
    5. How best to avoid attempts to add same DSGC to a single scene? (Not seen obvious answer yet. If none, perhaps some static-based reference in DSGC with tidyup in OnDisable() would be a viable? Patch?).
    6. If doing code for (5), would it hurt to do it as a count (think counting semaphore rather than lock)?

    Thanks in advance.
     
  10. 46465

    46465

    Joined:
    Dec 10, 2013
    Posts:
    18
    Am I the only one getting the following error when trying to build for windows store ?

     
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    No, I just turned off the Enemy Spawner script so you can mess around with the sounds without fear of dying. The instructions say this on the screen. You can turn on that script once you want enemies.
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Sounds like an error I fixed awhile ago with platform-dependant compilation...I'll look into it. Which platform is "windows store"?
     
  13. 46465

    46465

    Joined:
    Dec 10, 2013
    Posts:
    18
    Listed Under "Windows Store Apps" in the build settings, I tried both SDKs (8 and 8.1)
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    1. No, a Variation is only available is it's not playing or past its retrigger percentage. Otherwise there are no voices available so it fails to play. If there is an available sound to retrigger, it just uses the first one it finds. Not based on anything.
    2. You should put all audio under MA unless it's per-Scene audio. If you find a scenario where you don't want to for some reason, let me know and we'll get it added if feasible.
    3. Additional instances don't take up extra audio memory (unless they have Filter FX, so go overboard if you like. You should try to use a bus voice limit though, since there are only 32 Audio Sources available to play at once.
    4. No limits that I know if. We had probably 200 Variations on our first game. Why would there be a limit of non-playing Audio Sources? There is the limit stated above of playing Audio Sources.
    5. I believe that adding the same DGSC to the scene twice will have no ill effect. It checks if the Sound Groups, buses and events exist before creating them. So you will get a bunch of errors logged but no extra Groups. You could use a Pooling solution such as Pool Manager and limit the instaces of that prefab to 1. That would do it.
    6. Not sure code is needed there.
     
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Ok I'll check it out. Hopefully it's a quick fix.
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Master Audio V 3.3.7 is being submitted to the Asset Store now. Should be live in about 15 minutes. Bug fixes only this time:

    • Fixed bug where calling a PlaySound "AndForget" method would play all Variations!
    • Fixed mislabeled "Hierarchy View" warnings that were actually Project View.
    • Fixed "Windows App Store" compilation error hopefully.
     
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    I have a fix in the newest version which will be live in about 15 minutes. Hopefully it's a fix. I don't have Windows 8 on any computer so I can't actually test building it. Let me know if you still see any problems in the updated version. I'm on good ol' Windows 7.

    The same fix I had to make awhile ago for Windows Mobile 8, and that one works, so it's probably good.
     
    Last edited: Jan 26, 2014
  18. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    616
    Any chance to add this? Perhaps stick 'em in a FIFO?

    += "and per-Scene audio goes in DynamicSoundGroupCreator instances". (right?)

    So it's better to go overboard with numbers to ensure sufficient.

    Guess I'm still haunted by a stunning Unity optimization presentation I attended where they described the inefficiency of extraneous things in the scene and the hoops they'd jumped through to fix. Ever since, I've tried to keep everything minimal.
    Guess I'm hanging on to out-dated imperialist dogma that perpetuates the inefficiency in our society?
    Still, I guess you're right! (or right enough for now ;-) ) I'll proceed with abandon!

    Well, "no ill effect" does a load of work then logs a critical error. Better to avoid, I'd say.
    A Pooling solution *is* a good idea. I'll need to ensure the pools are all populated appropriately -- seems like another step to make a mistake in :-\

    That's a shame. I've created the code change and it does the job I wanted. Are you sure I can't tempt you with a quick look? I can share my testing project if it'd help? :)
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    #1, I think I'm going to redo the "pick a random Variation" code to keep track of which Variations are actually available if possible, so less guesswork is needed there. There is more information that's trackable now than when I first wrote that code.

    By the way, that patch you wrote for PlaySound3DAndForget means that if the random chosen Variation is busy, no others are tried. Did you know that? That PlaySoundResult was needed for that.

    #2, right
    #3, right
    #4, cool
    #5, ok
    #6, huh? I guess you didn't use Pool Manager for this. Did you write your own pooling / limiting system or what?
     
  20. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    495
    Ah, thank you...
     
  21. 46465

    46465

    Joined:
    Dec 10, 2013
    Posts:
    18
    Managed to build the demo scene, it seems like the problem has be resolved.

    Thanks for looking into this :)
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Awesome! Let us know if you have any other questions.
     
  23. jeffc42

    jeffc42

    Joined:
    Feb 9, 2013
    Posts:
    3
    I've just upgraded to the latest version and I see a new problem: a variation of a weighted sound sometimes fails to play. There is no error, and when I turn logging on it appears that every instance played successfully. This bug could have been introduced at any time starting with the introduction of the *AndForget methods. Turns out I had this problem using Arkade's patch as well, but didn't notice it earlier.

    To be specific... I have sounds that use weighted instances and a polyphony limit. The limit is not being hit, so that isn't the problem. The limit is per-sound only; no bus-level limit was set. I am using the *AndForget methods exclusively now (anything to cut down on garbage collection :)). Upping the instances and limit did not make it go away.
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Does it happen when you call the non "AndForget" method? I was going to redo the "pick a random variation" code anyway because I think it can be optimized (it's rather old and there's more information it could be using now). I'm aware that when using "AndForget", if the first random variation chosen is busy, it will not loop through the other variations to find one that isn't. This is because it relies on the PlaySoundResult to be able to do that, and it doesn't generate one. This may be that same bug.
     
  25. jeffc42

    jeffc42

    Joined:
    Feb 9, 2013
    Posts:
    3
    Bingo. Problem goes away when using PlaySound instead of PlaySoundAndForget.
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Yeah, I'm going to redo the "pick a random variation" code soon so it doesn't rely on the PlaySoundResult or have to look at all Variations if it is available. That should make this go away.
     
  27. mbreitkreutz

    mbreitkreutz

    Joined:
    Dec 4, 2013
    Posts:
    23
    I'm hearing a lot of stuttering when playing sounds attached to a moving object using PlaySound3DFollowTransform. However, the AudioListener is also a child of this object which means the listener is also moving. I can't tell for certain but it almost seems as though the audio and the listener are updating at different times. I don't hear the stuttering if I use PlaySound3DAtTransform or move the listener to be a child of the camera (which isn't really ideal). As a quick test, I made SoundGroupVariation.FollowSoundMaker not update the position and added SoundGroupVariation.Update to just update the position and this seemed to eliminate the stutter. I doubt this is the best solution but I thought the info might be helpful.
     
    Last edited: Jan 28, 2014
  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    That would be the *normal* way to do it, however on mobile that would be quite inneffient when following a whole bunch of objects around (say 50 enemies?). Bad performance, that's why I made it update every .1 second. You can always change the constant (time to wait between updating in the CoRoutine) from .1f to a shorter one like .05? That may be fast enough to not hear stuttering. I could also make that value configurable...

    If people don't mind the performance hit, I can always get rid of the CoRoutine and add it into Update as you have done. Opinions?
     
    Last edited: Jan 28, 2014
  29. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    127
    January 28th is the 1-year anniversary of Master Audio being released on the Unity Asset Store, so we're doing a $5 sale! That's 94% off!! Offer expires end of day January 29th. This is your chance to pick up the best and most advanced audio plugin on the store for less than the price of a lunch!
     
  30. mbreitkreutz

    mbreitkreutz

    Joined:
    Dec 4, 2013
    Posts:
    23
    Maybe it's only due to being attached to the listener that is also moving in our game. I can try only doing the Update if the listener is attached and for everything else use the normal operation.
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Ok, let me know what you discover.
     
  32. mbreitkreutz

    mbreitkreutz

    Joined:
    Dec 4, 2013
    Posts:
    23
    I just made the change to only use Update for attached sources that contain an AudioListener and it seems to work well. I can't really check performance on mobile though since I don't have access.
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Awesome - I'll see if I can add some kind of checkbox that you enable only for when the Listener is in the object making the sound.
     
  34. ismyhc

    ismyhc

    Joined:
    Nov 28, 2012
    Posts:
    10
    Im currently on version 2.6.

    Is there a way in code to determine the current playing song by clip name? I don't really want to upgrade Master Audio at the moment just so I can minimize issues since Im close to releasing a new build of my game.

    Thanks!
    Jacob
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    I actually don't have my old versions on hand. You can email me your PlaylistController.cs file and I'll take a look. Use support@darktonic.com

    Thanks!
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Master Audio V 3.3.8 is submitted and will be live in about 15 minutes. Changelog:

    • Fixed bug where PlaySound "AndForget" methods would not take a played Variation out of the randomizer. Not as random as it should be!
    • Fixed PlaySound "AndForget" methods to try all remaining Variations when the first one tried is busy.
    • Fixed ducking to work with "AndForget" methods.
    • Fixed Equalize Clip Volumes function to not assign zero volume and NaN volumes when one of the clips was streaming or compressed.
    • Added missing Resource folder detection to Group Variation and Dynamic SGC Variation Inspectors when in Resource folder mode.
    • Made random Variation pool refilling work by adding items back to random pool by ascending last played date. This way the when the first chosen is busy, the others will be tried in last played order. Most likely to work on second try.
    • Updated Playmaker Custom Actions to inclide a TooltipAttribute so they will still work on Unity 4.5.
    • Added a patch to update location more frequently when the Variation is following a prefab with the Audio Listener in it.
     
  37. WarpB

    WarpB

    Joined:
    Nov 12, 2013
    Posts:
    14
    Hey! I finally got round to adding audio to my game this morning and so far very impressed with how easy Master Audio makes it!

    I seem to have run into a snag though. I'm attempting to use a single 1 second laser clip for a high rate of fire weapon (5 shots a second at the moment, but up to 10). So I set up 10 sound "variations", but all using the same laser sound clip, and I use MasterAudio.PlaySoundAndForget("Laser"); inside my firing coroutine. It almost seems to work, and sometimes I will get a long sequence of shots one after another, but occasionally it seems to miss one, unless I make the retrigger percentage 20 percent (to match my 5 shots a second for the one second sound clip). With 10 variations I should have double the number needed to get a constant rate of fire of 5 a second, and the documentation suggests "Variations are played randomly from a pool and refilled after all have been played" which I took to meant there will be no repeats until all have been played, but I'm assuming that is not the case due to the randomly missed sounds.

    Is this a bug, or am I misinterpreting the documentation? If a bug, could it be related to the fact all my "variations" are actually exactly the same?

    I considered just making my own loop that simulated 5 shots a second, but in the long run I want to be able to have a wide variety of rates of fire for different weapons, so that will not work out.

    Any help is much appreciated! Thanks :)

    Additional: Before I hit the post button the "AndForget" part jumped to mind. As I read it, using AndForget means it doesn't return any info, but does it also mean the randomizer forgets which ones have already been played? I just did a test with MasterAudio.PlaySound("Laser"); and it seems to work perfectly.

    I guess I solved my own issue, but I'll post this anyway in case that is not expected behavior for PlaySoundAndForget :)
     
  38. Nekotika

    Nekotika

    Joined:
    Jan 31, 2014
    Posts:
    17
    Hi! I want to try this plugin before buying, is the free version still available?

    Thanks!
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    I have a copy of the free version that I can email out. It is quite old and missing a lot of features, but I can send it if you want. Email us at support@darktonic.com.

    With the amount of great reviews we have, we didn't think it necessary to keep offering the free version any more. Also, it didn't seem to affect our sales at all to go to the trouble of maintaining two versions all the time.
     
  40. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    If your variations are exactly the same, you only need one. Just up the "weight" property to 20 and it will create clones at runtime. If you don't have the latest version, I actually fixed numerous bugs with the "AndForget" in a new version that went live last night, including this one it sounds like.

    Let me know if the newest version fixes that for you.
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Master Audio V3.3.9 is being submitted and will be live in 15 minutes. Some new features!

    • Updated ButtonClicker (NGUI event script) to include OnHover and OnClick events as well. Thanks to Mike Breitkreutz for providing this update!
    • Added QueuePlaylistClip method to MasterAudio and PlaylistController. This allows you to play a song after the current song reaches the end. Loop is turned off for current song. Requires auto-advance to be on. You can add as many songs as you like to the queue and they will be played in order. Queued clips are all cleared when you change Playlists.
    • Made playing a variation by name find a non-busy Variation before giving up. Before it only looked at the first one it found.
    • Added display of active playing voices to each SoundGroup in the mixer, and a total at the bottom. When polyphony limit is reached, number is red.
    • Fixed Bus voice limit feature. It didn't work properly if you had more than one Group assigned to that bus.
    • Added display of bus active voices. When bus voice limit is reached, number is red.
     
  42. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,311
    Is there a way to set up a bunch of AudioSources (or something similar) around a level for environmental sounds, but have their volumes adjustable by categories in Master Audio? For example, I'd like to have campfires and fountains with attached 3D sounds throughout a level, but if the user adjusts the "Sound Effects" category volume in the menu, their volumes would be affected.
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Yes, there are at least 2 ways to do this. Sound Groups and buses. Buses are basically categories, but if you trigger individual variations in a Sound Group by name, you could use the Sound Group volume to control all of them as well.
     
  44. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,311
    I got that, but I was more wondering how to set up audio sources at locations within a level. I guess I should add an "EventSounds" component to each spot instead of an AudioSource, and set the clip to be played in OnStart? Is there a way to modify some of the 3D settings at each location (so not on just the clip itself within the MasterAudio object)? Min and Max Distance are probably the most important ones, since that's how I usually place a sound over a large area.

    Edit: Alternatively, if there was some way to assign a bus's volume to a regular AudioSource that would work too. I guess I could write my own script to link an AudioSource to a Bus.
     
    Last edited: Feb 2, 2014
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    You can set up 3d settings per variation. So if you need 2 copies of the same sound, but different 3d settings, make 2 variations of it. Yes, you could use Event Sounds like you described, or have them start via triggers or custom events.

    The goal in Master Audio is to have you never manually create or use any AudioSources directly. Master Audio will create them as they are needed an manage them. So far we haven't found a scenario where this will not suffice.
     
  46. NickHVenden

    NickHVenden

    Joined:
    Aug 3, 2013
    Posts:
    33
    Brian Hunsaker and the creators of Master Audio.
    MA is fantastic! Thank you.
    The interface is compact and easy to navigate.
    The Synkro work beautifully and it has allowed me to do some very musical design.

    All that said...
    Can you help with the Collider option in the Event sounds script. I've tried attaching it to various objects, both doing the colliding or receiving the collision, changed the rigid body components, and the kinematic choices (should not matter there), and I cannot get the collision to work in the Event Sound component. The Trigger Enter/Exit all seem just right.
    What am I missing?
    Nick Venden
    CSULB grad student interactive technology - music composition.
     
    Last edited: Feb 2, 2014
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Thank you! You can't have triggers and collisions work at the same time on the same object.

    i.e. You'll need to turn "is trigger" checkboxes in both colliding objects (in the Collider component) off to get collisions to work instead of triggers.
    Other than that, one of the 2 colliding objects must have gravity turned on, and both must have a Rigidbody. It's always one of these simple yet important things that gets me.

    That should take care of it for you. If you're using 2d colliders, make sure you're using the right event!
     
  48. HannesB

    HannesB

    Joined:
    Oct 29, 2012
    Posts:
    10
    Hi,

    thanks for the great master audio asset, I am using it in my game to play sound effects and background music successfully.

    But I have one question: How to I dynamically change the pitch of a sound effect while it already is playing?

    I added a "motor sound", which changes it's pitch, based on some speed: MasterAudio.PlaySound("engine sound", 1.0f, GetSoundPitchForVehicleSpeed(vehicle.speed));

    This is working but the sound effect does not change it's pitch, when the vehicle.speed variable changes it's values.
    Nothing wrong here, This is how I expect it to work - it starts playing the sound at the specified pitch.
    The sound itself is set to "looping".

    But how do I change the pitch of the playing sound?
    I guess i need to get some reference to the sound to change it's pitch, while it is playing but the "PlaySound" method does not return this.

    Maybe this should be done completely different - can you tell me, how?

    thanks,
    Hannes
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    Actually, PlaySound does return it. PlaySoundAndForget does not.

    You can do (mentioned in the readme):

    Code (csharp):
    1. var result = MasterAudio.PlaySound ("Engine");
    2. if (result.SoundPlayed || result.SoundScheduled) { // check for success
    3.   result.ActingVariation.audio.pitch = .5f; // any pitch you want
    4. }
     
    Last edited: Feb 3, 2014
  50. HannesB

    HannesB

    Joined:
    Oct 29, 2012
    Posts:
    10
    Wow - I did not expect such a fast reply!
    Thanks - it works perfect!
     
unityunity