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

[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. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    97
    Thanks for your help!

    Perhaps there's a better way to do this? Here's the scenario: several identical computers in a room randomly emit sounds from the same group of variations. Another example someone mentioned was zombies that make various groaning sounds randomly. This seems a good fit for Ambient sounds because you shouldn't hear ones that are too far away but they should always be making sounds if you're in hearing range without needing any particular event trigger. Seemed like a good fit for a shared Sound Group set to chained loop because you want them all to continuously emit sounds with random delay between sounds and Chained Loop allows for that. When I use chained loop, only the first item emits the sounds. When I use normal mode, it's the same but that object only emits a sound once.

    What's the intended way to handle multiple objects that share the same group of ambient sound variations?
     
  2. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Did you notice the note in the Inspector under Chained Loop? It says, "In Chained Loop mode, only one Variation can be played at a time". That means 1 total. It can't work with multiple callers.

    I believe you're going to have to make duplicate Sound Groups so you can do this. And that isn't so great because they can't be exactly the same prefab.

    You also could possibly do it with multiple Playlist Controllers on shuffle mode.

    Also there's a new feature for Linked Groups in the update that just went out today. You can define "End Linked Groups" that play when the Sound Group finishes. In this way, you could define a series of Groups to play randomly from when one Sound Group finishes. This might get you what you want.

    Let me know what you go with and what works, or not.
     
  3. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    240
    Hi!

    Quick question, Does firing a variation from a soundgroup via the Event Sounds script linked to a custom event cost more than firing the soundgroup's variation directly?

    I was getting game lag from a bunch of "event fired more than once on this frame" notices, so I fixed it with retrigger limits. But I have a LOT of Event Sounds and custom events. So would it be more efficient to play a sound from the group directly instead of using an Event Sounds script with a custom event all together?

    Thanks!
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Yeah whenever something logs to the Console it slows things down a lot, but it's still the best way to give user feedback that they're doing something wrong.

    If you only have a single listener for most/all of your Custom Events, then I question why you'd even be using them? Yes it's more efficient to just play a sound directly. The more Custom Event Listeners you have, and also if you're using the advanced modes of "closest 4 Listeners", that can take a little CPU hit while it figures out which Listeners to notify. Please describe why you chose to use Custom Events and I'll let you know if it is necessary or not for what you're doing.

    Maybe it's because there are ways to fire Custom Events without writing any code (wave completed event, etc) that you're using them?
     
  5. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    240
    Well here is an example.

    When the player hits an enimy, it would play one of a few hurt sounds in a soundgroup. The reason I was using the event sounds is that it made it easy to edit these since I am not the programmer. We used to have it so that they would call the sound in code, but because it was hard coded into a script, I was unable to edit or modify it. So we used an Event Sound for that enimy type so that it would play from whereever it needed to play from and I cou,ld go and change something if I needed to.

    The custom event was linked to an event sounds script which was attached to a prefab of the enimy. That way it would know where to play the sound from.

    The programmer said that they could expose a bunch of string variables in the inspector where I could place in each group name of a sound that was suppose to play, that way we wouldn't need events.

    So I guess we're pretty much using events for everything... xD
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Well "when the player hits an enemy" can probably be done with EventSounds script anyway, using the Trigger Enter or Collision event. No need for Custom Events.

    If you do need event triggers that aren't built into Event Sounds (all the normal MonoBehavior stuff is there though), then yeah the programmer can expose string variables decorated with the SoundGroup attribute, that way it will automatically show a dropdown for you to choose a Sound Group in the Inspector. Easy peasy.

    like this:
    Code (csharp):
    1.  
    2. [SoundGroup] public string HitSoundGroup;
    3.  
     
  7. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    240
    Ah thanks. We'll try that out!
     
    jerotas likes this.
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    New video up for Ambient Sounds script:

     
  9. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    444
    Thank you so much for all this info. Your support is 10-star!
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Thank you, we do our best! Let us know if you have any other questions or concerns.
     
  11. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    @jerotas
    Hey, something I keep adding to Master Audio after every update is a checkbox for Raycast Hit Triggers in the Occlusion settings. Which basically controls Physics or Physics2D.queriesHitTriggers
    You might want to add that control, since its really useful.

    Cheers
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Ok, didn't know about that. Added to roadmap.
     
  13. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    240
    Is it possible to copy an Audio Group from one Master Audio object to another? Including dynamic Master Audio objects.
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    V 4.1.0 changelog:
    • Fixed bug: Scene reloading would cause Custom Event Listeners to be shown increasingly more times as Listeners in the Inspectors.
    • Fixed bug: If LowPassFilter already exists on Variation, Occlusion will log error when trying to add the Component.
    • Fixed bug: Dynamic Sound Groups with "Use Localized Folder" would not correctly unload Resource files when the DGSC was disabled.
    • Added "Add to Ducking" button to Bulk Group Changes section on Group Mixer. Will add all selected Groups to Music Ducking.
    • Added "Use Spatializer" checkbox on Advanced Settings for Unity 5.4 and up. If checked, and you have selected "OculusSpatializer" from the Spatializer Plugin dropdown on AudioManager screen, then "Spatialize" checkbox on all Audio Sources for Sound Groups will be checked when you click enter Play mode.
    • Added Audio Source Template of "Max Distance 10" and tweaked all Audio Source Templates so 0 is reached at max distance.
    • Added option for Occlusion to choose whether "Ray Casts Hit Triggers". Defaults to true as that's the normal Unity option.
    • Fixed Unity 5.6 compilation error.
     
  16. Argiris

    Argiris

    Joined:
    Nov 14, 2014
    Posts:
    23
    Hello.

    Just a quick question: is it possible to setup a playlist that persists throughout every scene, without writing code?

    Thanks!
     
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    There's a checkbox to "Persist Between Scenes" on the Master Audio game object. Playlists are by default part of the Master Audio game object, so that's all you need to do. Playlist Controllers in the Scene will also "persist" if you check that box.
     
  18. Argiris

    Argiris

    Joined:
    Nov 14, 2014
    Posts:
    23
    Thanks a lot for the swift reply, jerotas! :)
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Any time!
     
  20. kurismakku

    kurismakku

    Joined:
    Sep 18, 2013
    Posts:
    39
    Hi :) I got few questions

    1) How to play two music tracks at once? If I play one of them as sounds, than they will not be affected by standard master music volume settings.

    2) How to loop a sound effect?

    3) How to use Ambient Sound? I added it to the doors object, but I cannot hear anything. I would like that the volume of the sound increases if the player object is nearby. Do I need to add something to the player?

    4) How to stop individual sound?

    5) How can I play the same sound multiple times? I need to play the same sfx even before the last one is finished. MasterAudio.PlaySound returns null / false for this cases.
     
    Last edited: Apr 17, 2017
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    #1, why would you play them as sounds? That won't give you any Playlist functionality at all. To play more than one music track at once, you need more than one Playlist Controller. Each Controller can host a single Playlist and play single songs from it. So if you want to play 3 songs at once, you would need 3 Controllers. Here's the video showing how to set up multiple:
    . You will probably want them synchronized too, which is shown in the video.

    #2, to loop a sound effect, you have to set it as looped before hitting play, in the Variation's Inspector. There's a loop checkbox there.

    #3, if you can't hear anything, then the sound effect is out of audible range (i.e. your Audio Listener is further away from the door than the Max Distance of the Audio Source playing the effect. You will probably want to use a different Audio Source template with a larger range. Watch the Ambient Sound video here, here:


    #4, That depends on how you played the individual sound. Please show me a screen shot of how you did that (coding / Event Sounds, etc). I'll show you how to stop it after I know how it was triggered.
     
  22. arcdragon1

    arcdragon1

    Joined:
    Oct 15, 2012
    Posts:
    118
    Hi team. i found error in unity2017 beta. master audio version is 4.1.0. what should i do? :)

    Code (CSharp):
    1. Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs(5597,44): error CS0117: `DarkTonic.MasterAudio.AudioResourceOptimizer' does not contain a definition for `RemoveLoadedInternetClip'
    2.  
    3. Assets/Plugins/DarkTonic/MasterAudio/Scripts/Settings/SoundGroupVariation.cs(216,51): error CS0117: `DarkTonic.MasterAudio.AudioResourceOptimizer' does not contain a definition for `PopulateSourceWithInternetFile'
    4.  
    5. Assets/Plugins/DarkTonic/MasterAudio/Scripts/Settings/MasterAudioGroup.cs(195,40): error CS0117: `DarkTonic.MasterAudio.AudioResourceOptimizer' does not contain a definition for `RemoveLoadedInternetClip'
    6.  
    7.  
     
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    I don't even know what Unity 2017 is. Why do people feel the need to install buggy beta software? I'll never understand. I feel no need whatsoever :). Anyway, for me to be able to fix that, I'll need access to the beta. Where do I get it?

    It's only needing some conditional compiling directives. Should only take me about 10 minutes to fix.

    We don't officially support unlreleased Unity versions with any of our plugins, but if someone lets us know that it's broken, we can fix.
     
  24. arcdragon1

    arcdragon1

    Joined:
    Oct 15, 2012
    Posts:
    118
    Oops sorry. I seem to have jumped to the conclusion. beta is https://unity3d.com/unity/beta
    I think you don't need to fix too.
    I welcome you to fix other essential bug.:)
     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    I don't know of any bugs right now. We generally fix them as soon as we hear about them (same day). Thanks for the link, I'll download the beta tomorrow and hopefully have a fix for you. Please email support@darktonic.com asking for the fix, and include your Asset Store invoice PDF showing that you bought the plugin.

    -B
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Today I fixed all 4 of our plugins to compile on Unity 2017 beta. If you email support we can send it to you, or you can wait for the update in a few days.
     
  27. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    389
    Hey Brian

    I'm having a problem with MasterAudio.StopAllSoundsOfTransform() and wondered if you could help.

    Basically I kick of a looped positional sound in code using PlaySound3DAtVector3() for a particular game object and want to manually turn it off using StopAllSoundsOfTransform() but it appears not to stop the sound at all. I stepped through the code and it may be that the sound is not attaching to the transform ?

    If I use MasterAudio.StopAllOfSound(Sound.name); then that works, but it is not what I want because I may have multiple instances of the positional sound in play.

    Do you have any ideas or could you point me in the right direction please?

    thanks

    Nalin
     
  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    StopAllSoundOfTransform works for sounds that you have played while specifying a Transform, such as PlaySound3DFollowTransform or PlaySound3DAtTransform. PlaySound3DAtVector3 does not record the Transform since you're not passing it into the method, so StopAllSoundOfTransform will not be able to find it.

    So you should use PlaySound3DAtTransform instead.
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Master Audio (and all other Dark Tonic plugins including the unique Master Audio Multiplayer and Core GameKit) are now 30% for a limited time!
     
  30. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    240
    Do you know if Master Audio works with the Steam Audio plugin?
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    There is zero integration but it "works" according to this thread.

    https://forum.unity3d.com/threads/steam-audio.457928/

    I have asked a couple people what it would take to integrate but received zero responses, so it's staying at the bottom of the roadmap until I get some feedback.

    Also, last release now adds Oculus Spatializer integration though for Master Audio.
     
  32. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    240
    lol small world. I'm actually on a team with the person who tested it. (Ironically I'm the sound designer for said team). I'll reach out to him and see how he set it up as well as trying to test it myself and get back with you.
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    That's awesome, do let me know!

    It could be a quick integration, in which case it will go to the top of the roadmap.
     
  34. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    389
    thanks so much Brian!
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    No problem!
     
  36. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,311
    Did this update ever go live? I had to manually change all of those "#if UNITY_5"s everywhere into "#if UNITY_5_3_OR_NEWER"s to get it to compile in the beta.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Actually no it didn't. I'll get that done Monday.

    Good that it's working for you now.
     
  38. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    V 4.1.1 will be live in 20 minutes. Changelog:

    • Fixed compile errors for Unity 2017 beta.
     
  39. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    155
    Hello, I think this is my first post since purchasing the asset quite some time ago so let me first say that Master Audio has been an absolute pleasure to use so far. Possibly some advanced video tutorials would be nice but the ones I have seen have me headed in the right direction.

    Anyway, the reason for this post is that today I went to swap all WAV files to MP3 (due to what I think is some misinformation I found). Although I have gotten around any issues that I ran into by just reverting to a backup I am now curious about how I would go about doing something like this. i.e.: what I did today was look under the MasterAudio Prefab and drag and drop the MP3s into all of the missing audio slots (they were missing because I moved the original sound files into a sub-folder). For the most part this seemed to work but failed on anything where I had audio clips being initiated from some key presses (and GUI joystick/button stuff).

    Is this a bad way to do this? Should I have cleared out all audio files from the MasterAudio prefab and then gone through the whole setup process again as though I had just installed the plugin for the first time?
     
  40. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Most likely the "misinformation" was actually correct. I would strongly advise against using mp3 for ANY sound effects (if you only have mp3's, convert them to something else), but it's ok for music files in a Playlist. The reason is because it takes about 120 times as long for an mp3 to start playing vs a wav or ogg file, and that actually makes the performance of your game a lot worse every time you play one (frame speed will be much slower for that frame).

    But yes if you want to replace files with any other files, no need to recreate any Sound Groups or anything like that, just fix them in the Variation or Sound Group as is.

    -Brian
     
  41. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    155
    Hey Brian, thanks for that info. All sorted and back to WAV format again. I knew there were issues with using MP3 format and the misinformation was possibly misinterpretation at my end as I was watching a Unity Dev Conference video about mobile optimisation - so more than likely they were referring to the use of MP3 compression being better for iOS.
     
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Sounds good, any time!
     
  43. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,311
    So, I have two sounds: a charge-up sound and a charge-loop sound, and I want to transition from the charge-up to the charge-loop with no gap. What's the best way to do this? I don't think I can use a "chained loop" group because you're not allowed to set any of them to looped mode, and the charge-loop needs to be looped.
     
  44. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Use a Linked Group. Put those 2 sounds in different Groups, then add a Linked Group from the one that plays first, to tell it to play after that one is done.

    Each Sound Group has "Linked Group Settings". You expand that and add "Stop Linked Group" so it will play the Groups(s) you specify when this Sound Group is done playing, or one at random. You can do this to set up a huge chain of related Sound Groups if you like.
     
  45. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,311
    Awesome, new question though... is there a way to get a reference to that loop sound once it's playing so that I can end it? I tried using the PlaySoundResult.ActingVariation from playing the start sound, but it is no longer active when the sound switches to the loop, and I'm not sure how to get the right Charge Loop when I want to stop it, since there might be multiple copies of it playing.
     
  46. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Correct, you won't be able to get the PlaySoundResult at all because you don't tell it to play, it just happens automatically.

    You will have to tell it to stop with one of the "OfTransform" methods like these:

    MasterAudio.StopSoundGroupOfTransform
    MasterAudio.FadeOutSoundGroupOfTransform
    MasterAudio.StopAllSoundsOfTransform

    These will stop the correct Variation that's playing for that Transform and not any others.
    -B
     
    makeshiftwings likes this.
  47. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    155
    Hello, today was my first ever attempt at looking into audio options via a UI (like SFX/Music volume levels). I managed to get the Music Volume slider working by dragging the PlaylistController onto the Music Volume slider but can't seem to work out the SFX ones. I am shutdown at the moment but I was trying to drag the MasterAudio prefab onto the SFX Volume Slider (button-click) slot but it said something like 'missing MasterAudio.set...'.

    If anyone can point me in the right direction it would be greatly appreciated.

    I also wondered if it's possible to control 2 x separate SFX volume levels (Player and Environment). I am working on a little racing game and wanted to give the extra option for engine volume.
     
  48. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    That sounds like you are trying to directly hook up our game objects to the UI stuff. That might have worked for a single Playlist Controller and stock settings but that's not the correct way to do it and wouldn't work with layered music (multiple PlaylistControllers) or for SFX, as you have seen. That's because all methods on the MasterAudio script are static.

    Instead, put an EventSounds component on the slider game object, activate the appropriate Slider event and use the "Global Control" action type, commands of "Set Master Mixer Volume" (SFX) and "Set Master Playlist Volume" (music) for the 2 sliders. I believe this is shown in the 4.6 UGUI video for Master Audio on Youtube (check the stickied videos thread on our support forum).

    If you want to have different groups of SFX and set those volumes, then instead of Set Master Mixer Volume, do this:
    1) Assign all Environment Sound Groups to a Bus named "Environment" or whatever, etc. Do the same for all Engine sounds and whatever else you want to group.
    2) On EventSounds use Action Type "Bus Control" and Bus Command of "Fade To Volume", selecting one of the Buses you created above. You can choose to have the fade happen instantly if you want with a short time specified.
     
  49. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    155
    Hello Brian, much thanks for providing that information, I will have another go at it later today. Yeah I was going to go through the videos again last night but ended up slowing going through this thread to see if anyone else had asked a similar question. Nice to read that you have kept some focus on making the plugin easy to use for the not-so-good-at-coding types like me whilst still being advanced enough to handle pretty much anything that I might throw at it.
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,136
    Yeah, that's the primary goal actually. To make it so Playmaker users and other non-coders can pretty much do whatever they want without writing any code. But yeah there are a few instances when you might need a line or 2. You're welcome!
     
unityunity