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
    Which multiplayer package are you using? Photon, Photon2, UNET, Mirror? Are you sure you installed the correct one for what you're using?
     
  2. Thrazamund

    Thrazamund

    Joined:
    Apr 14, 2017
    Posts:
    36
    I have bought this but I'm not seeing any video or advice on how to integrate the new version into a project using the previous Master Audio asset. Is there no easy way to do this? Do I have to recreate everything?
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You can just install over the top of the old. It's the same files plus a few more.

    Or if you want to be "cleaner", you can delete all the "DarkTonic" folders, restart Unity, then install MA22.
     
  4. Thrazamund

    Thrazamund

    Joined:
    Apr 14, 2017
    Posts:
    36
    Ok, I will try that. Thanks. I upgraded mainly because it sounds like there are more sophisticated occlusion options in the new version. Is that correct?
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Well, no. One occlusion bug was found and fixed though. The main new features are multiplayer plus "section looping" of a song.

    Thank you for the support though :)
     
  6. techniquea2z

    techniquea2z

    Joined:
    Jun 3, 2017
    Posts:
    37
    So, I got a composer on my team. He immediately pointe out that it wasn't as "Seamless" as I'd thought:

    The music in the tavern has a gap between intro and loop section:



    He'd like for me to use Introloop: https://assetstore.unity.com/packages/tools/audio/introloop-51095

    Does 2022 have this sort of functionality -- it is really is rather essential.
     
  7. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It does. The main additions for 2022 are section loop and multiplayer functionality.

    -Brian
     
  8. techniquea2z

    techniquea2z

    Joined:
    Jun 3, 2017
    Posts:
    37
    Awesome!!

    So, is the upgrade seamless? Simply install the 2022 unitypackage?
     
  9. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yes, and yes :)
     
    techniquea2z likes this.
  10. techniquea2z

    techniquea2z

    Joined:
    Jun 3, 2017
    Posts:
    37
    Alright, purchased and updated!

    Curious to know where the section loop functionality on SoundGroups are.
     
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you for your business. It's not for Sound Groups, it's in the Playlist Controller, for Playlists.

    If you scroll down near the bottom of this page, you'll find this below.

    upload_2022-3-6_20-49-52.png
     
  12. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    102
    Hello, is it possible to send custom events like you can "ActivateCodeTriggeredEvent?"
     
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yes, you can send (fire) Custom Events from code with a 1-liner, or from Event Sounds script based on MonoBehaviour events, and also from various other places in the our Inspectors.
     
  14. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    102
    Thank you for the reply and I'm sorry, I completely messed up my comment. Can you send Custom Events from an *animation event*, like you can with "ActivateCodeTriggeredEvent?"
     
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It's a static method you can call, so however you do that, yes. I use mechanim myself so not familiar.
     
  16. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    102
    Ah I just noticed "Machanim State Entered".

    But Yeah I was talking about this.

    upload_2022-3-7_19-33-59.png
     

    Attached Files:

  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yes, you should be able to call a static method from an Animation Event. I'm not familiar with exactly how that's done though.
     
  18. techniquea2z

    techniquea2z

    Joined:
    Jun 3, 2017
    Posts:
    37
    Hmm, so this poses a bit of an issue for my usecase.

    I don't currently use Playlists at all, just SoundGroups and Audio Buses.

    I don't mind using them, but can I have a song in a playlist attached to a certain bus?

    Also Section Loop seems to only play the certain looping section -- what I'm looking for is to play the start of the audio once, then loop the section indefinitely.

    In this way, the Linked Sound Groups worked nicely but just wasn't seamless...
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You don't (use Buses on Playlist). Buses are for Sound Groups. Playlists route directly to Unity Mixer Groups.

    You can accomplish what you want with 2 songs, both using the same Audio Clip.
    1) Intro section, non-looping.
    2) Looping section.

    Also, in my testing, End Linked Sound Group transitions are always seamless. That fix was done in 2018.
     
  20. techniquea2z

    techniquea2z

    Joined:
    Jun 3, 2017
    Posts:
    37
    This is pretty much exactly what we're doing right now -- and there is a bit of a noticeable gap:



    There is a noticeable skip between the linked sound groups... not seamless. The audio files are set to streaming.

    Do I need to store them in memory? Perhaps use Resource files?
     
    Last edited: Mar 7, 2022
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Maybe it's that they are streaming. I only tested with Audio Clip and maybe Resource file. You can try some different methods.
     
  22. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    102
    Hey @jerotas I'm trying it the mechanim way But the sound doesn't seem to fire. I copy and pasted the name so I'm not sure why its not working


    upload_2022-3-8_2-29-49.png

    upload_2022-3-8_2-30-25.png
     

    Attached Files:

  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yeah that's definitely not going to work that way.

    It's a static method you're calling, and not on a script that's on the game object. You don't need Event Sounds at all. You need to find how to call MasterAudio.FireCustomEvent method...I'm not sure how exactly you do that from an Animation Event, but you'd want to ask on the normal Unity Animation forum over here: https://forum.unity.com/forums/animation.52/
     
  24. Dainofel

    Dainofel

    Joined:
    Oct 12, 2019
    Posts:
    35
    Hello,

    I have a question.

    I've reached the stage in my game where I have to design the Ambient Sounds.

    I have to play Ambient loops, and it's working fine. However, the sound is really low. I've looked for options to increase the sound, but all the options have a hard cap of 0.

    Is there anyway to increase the sound volume beyond what it originally is?

    Thanks for the help!
     
    Last edited: Mar 10, 2022
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If it's too quiet, you'll need to change your 3d settings (min / max distance) for that Sound Group. There are Audio Source templates for this in Master Audio or you can tweak them with the min / max distance sliders built into Ambient Sounds Inspector.

    To hear the max volume, temporarily send the Sound Group to a Bus and click "Force to 2D" on the bus. If that's not loud enough, you would need to actually edit the Audio Clip in a program such as Cakewalk and make it louder.
     
  26. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    102
    For some reason I got it working. I'm not sure what I did because I was half awake, but the next day I found it works! lol.

    I have noticed that there is master audio play sound but no stop sound? What if its looping?
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There are scads of stop sound methods. StopSoundGroupOfTransform, StopBus, and a lot more. Individual Variations also have a Stop method.
     
  28. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    102
    Yes I have been able to find Bus Stop, mixer stop, everything stop and so forth. Sorry if its obvious, but I'm having difficulty finding a way to stop an individual variation.
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You usually don't need to stop an individual variation per se. You can stop all of the Sound Group that's playing from your Transform. Which usually is just 1. So that's usually what's used.
     
  30. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    102
    Ah right. So its best to never mix sound fx with diferent purposes in the same group? I have found Stop Transform Audio.
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It depends on the usage. For dialogue, you might have a ton of different dialog clips in the same Sound Group. Otherwise, Variations should really be Variations of the same sound (3 jump sounds etc) usually.
     
    Sapien_ likes this.
  32. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    102
    I guess you could also Group stop and then variation play another in the same group.
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Dialogue groups do that automatically, so just set it as a dialogue group if that's the way you want it to work.
     
  34. Dainofel

    Dainofel

    Joined:
    Oct 12, 2019
    Posts:
    35

    Thanks for the help, I will have to modify the original audio file then.

    Also, I have all my ambient loops in one sound group. I have a base "Wind" one, and another "Forest Wind" that increases or decreases relative to the amount of trees nearby.

    My question is - is there a way to fade the volume of a single variation within a sound group? FadeSoundGroupVolume modifies the volume of the entire sound group. I want to keep the base Wind loop the same volume, but the Forest Wind sound loop increase, decrease, or fade out entirely depending on the number of trees.

    Thanks for the help!
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You can use code like this to do it based on the "Actor" or transform that played the sound.
    Code (csharp):
    1.  
    2.             var sounds = MasterAudio.GetAllPlayingVariationsOfTransform(this.transform);
    3.             for (var i = 0; i < sounds.Count; i++)
    4.             {
    5.                 var aSound = sounds[i];
    6.                 if (aSound.ParentGroup.GameObjectName != "YourSoundGroupName")
    7.                 {
    8.                     continue;
    9.                 }
    10.  
    11.                 aSound.FadeToVolume(.5f, 1f);
    12.             }
    13.  
    I will make a helper method out of this since it seems useful.
     
  36. Dainofel

    Dainofel

    Joined:
    Oct 12, 2019
    Posts:
    35

    oh great, that will come in handy.

    However, I have an issue - I have a central SoundManager class. All transforms and methods refer to this class to play Sounds. So that means that every sound is being played by the same transform.

    Are there any workarounds to this? Is there anyway to get the specific SoundGroupVariation from a SoundGroup based on its index? There is only one voice assigned to the Loop I'm looking for, so I know it's going to be something like "SoundGroupName.SoundGroupVariations[1]"

    edit: I think I can use "GetAllVariationsOfGroup" to retrieve the list and then find the variation playing manually!

    edit2: It actually doesn't work - but I can use this method with a code like this and get all variations inside a SoundGroup:
    Code (csharp):
    1.  
    2.  
    3.         ambianceVariationInfo = MasterAudio.GetAllVariationsOfGroup(ambiance);
    4.         for (int i = 0; i < ambianceVariationInfo.Count; i++)
    5.             ambianceLoopVariations.Add(ambianceVariationInfo[i].Variation);
    6.     }
    7.  
    I guess that would work, right?
     
    Last edited: Mar 11, 2022
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    In that case, you'll need to get a handle on the Variation when you play it so you can fade it later.
    Code (csharp):
    1.  
    2. var result = MasterAudio.PlaySound("YourSoundGroup);
    3.  
    4. // later
    5. result.ActingVariation.FadeToVolume(.5f, 1f);
    6.  
     
  38. Dainofel

    Dainofel

    Joined:
    Oct 12, 2019
    Posts:
    35
    Thanks for the help. I got it working by building a list of soundgroupvariations at start from the MasterAudio.AudioInfo of the SoundGroup.

    I think I ran into a bug tho - if I'm playing a Loop variation, moving the Group Master Volume of the Master Audio Group in the Sound Group game object does nothing.

    If I move the sound group volume from the MasterAudio game object, the variation playing goes to -90 volume right away. Moving the volume from the MasterAudio GameObject does not restore the volume of the variations playing, they are all set at -90

    The reason why this is important is because when I use the "FadeSoundGroupToVolume", the volume of the SoundGroup fades away, but the volume of the variation itself goes to -90 right away, so even though the sound group volume fades away, the sound still ends abruptly.

    I hope the explanation is clear. Thanks for the help!
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thanks, I wasn't aware of this. Here's the fix, goes at line 176 in MasterAudioGroupInspector.
    Code (CSharp):
    1.  
    2.           if (newVol != _group.groupMasterVolume) {
    3.                 AudioUndoHelper.RecordObjectPropertyForUndo(ref _isDirty, _group, "change Group Master Volume");
    4.                 _group.groupMasterVolume = newVol;
    5.  
    6.                 if (Application.isPlaying) {
    7.                     MasterAudio.SetGroupVolume(_group.GameObjectName, _group.groupMasterVolume);
    8.                 }
    9.             }
    10.  
    The part you're adding is:

    Code (csharp):
    1.  
    2.                 if (Application.isPlaying) {
    3.                     MasterAudio.SetGroupVolume(_group.GameObjectName, _group.groupMasterVolume);
    4.                 }
    5.  
    It will be in the next update.
     
  40. techniquea2z

    techniquea2z

    Joined:
    Jun 3, 2017
    Posts:
    37
    Hmm, I really hate to be an annoyance -- but I've tried as a Resource File and set the load type to "Compressed In Memory"... there's still a skip between the sound groups...



    (at 0:27 and 1:11, you can hear the lull between the two audio groups)

    At this point, I'd probably just be better off using Introloop and utilizing Master AAA's busing settings to ensure it plays at the appropriate volume.

    I'd hoped I could get it be seamless using Linked Groups, but it doesn't appear to be working... (and my composer isn't happy lol)

    I suppose I'll try digging into the internals of the Stop Linked Group code and hoping I can find a solution
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Well it works for me last time I tried. You can send me a Scene with your setup for me to check it out and fix if you like.
     
  42. techniquea2z

    techniquea2z

    Joined:
    Jun 3, 2017
    Posts:
    37
    My project is open source -- but I imagine it's asking a lot for you to take the huge amount of time to import and run it.

    I'll start a small clean project and try to replicate the issue.
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yes, that's best. A small scene. Just the part that's causing you issue.
     
  44. techniquea2z

    techniquea2z

    Joined:
    Jun 3, 2017
    Posts:
    37
    I've done it!

    Since it includes the source, maybe I should email it?

    Simple scene, setup the linked groups and there's still a small lull.

    Also, I noticed there's some missing audioSourceTemplates? The ones that are Max Distance 500, etc. -- get a error when trying to create a SoundGroup with those.
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yes, email is fine. You can use filemail.com if you don't have a free hosting service.
     
  46. techniquea2z

    techniquea2z

    Joined:
    Jun 3, 2017
    Posts:
    37
    Sent it over!

    Super simple scene using the same audio I do in my project.
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thanks, will take a look when I have free time.
     
  48. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    102
    What if you have enemies but you want them to stop making a sound. Group stop would stop all of them wouldn't it? I have an enemy that screams. I want it to stop the scream as it dies. But if you kill more than one, they can't all stop the group can they?
     
  49. techniquea2z

    techniquea2z

    Joined:
    Jun 3, 2017
    Posts:
    37
    Not the author, but when you programmatically play a sound like so:

     MasterAudio.PlaySound3DFollowTransform(soundToPlay, transform);


    It returns a `PlaySoundResult`. Which has a:

    public SoundGroupVariation ActingVariation


    So you could store the reference to the PlaySoundResult, then call:


    var deathScreamSound = MasterAudio.PlaySound3DFollowTransform(soundToPlay, transform);

    UponDeath += delegate() { deathScreamSound.ActingVariation.Stop() }
     
    Sapien_ likes this.
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Correct. You could also do it with no code, with Event Sounds script.

    upload_2022-3-17_9-38-8.png