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
    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.
     
  2. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    253
    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!
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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?
     
  4. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    253
    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
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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.  
     
  6. Dreamcube017

    Dreamcube017

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

    jerotas

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

     
  8. username132323232

    username132323232

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

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you, we do our best! Let us know if you have any other questions or concerns.
     
  10. 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
     
  11. jerotas

    jerotas

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

    Dreamcube017

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

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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.
     
  15. 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!
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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.
     
  17. Argiris

    Argiris

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

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Any time!
     
  19. kurismakku

    kurismakku

    Joined:
    Sep 18, 2013
    Posts:
    66
    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
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    #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.
     
  21. arcdragon1

    arcdragon1

    Joined:
    Oct 15, 2012
    Posts:
    116
    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.  
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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.
     
  23. arcdragon1

    arcdragon1

    Joined:
    Oct 15, 2012
    Posts:
    116
    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.:)
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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
     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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.
     
  26. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    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
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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.
     
  28. jerotas

    jerotas

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

    Dreamcube017

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

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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.
     
  31. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    253
    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.
     
  32. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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.
     
  33. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    thanks so much Brian!
     
  34. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No problem!
     
  35. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    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.
     
  36. jerotas

    jerotas

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

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

    jerotas

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

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

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    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?
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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
     
  40. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    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.
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sounds good, any time!
     
  42. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    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.
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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.
     
  44. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    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.
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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.
  46. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    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.
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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.
     
  48. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    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.
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    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!
     
  50. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hey Brian, I have just been trying to convert my own vehicle script to MA. The way I have it setup thus far is an if/else statement that's basically just saying that if the vehicle engine idling sound is currently playing then stop it and play the engine driving sound. I have other sounds set up as well but I think that if I can work out this conversion part I should be able to tackle the rest.

    An example of my code is below but I was wondering if you could point me in the right direction with regards to what methods I should be using in the if/else part. I tried a few here but ran into trouble and a quick trawl through the forum didn't yield any results.

    Also, what would you suggest for when this script is on multiple vehicles and I need it to play the correct sounds for each vehicle when they are instantiated? I had thought Buses or Tags. Or would it be better for me to do one of these scripts for each vehicle perhaps? Unfortunately my skills are all in CGI so anything I do in code is usually along the lines of 'it's kinda working but will need to be redone properly later down the track' but I guess that most importantly I understand what I have written.


    Code (CSharp):
    1. // If there is no input (the vehicle is stationary)...
    2.             if (Mathf.Abs (m_MovementInputVertical) < 0.1f)
    3.             {
    4.                 // ... and if the audio source is currently playing the driving clip...
    5.                 if (m_MovementAudio.clip == m_EngineDriving)
    6.                 {
    7.                     // ... change the clip to idling and play it.
    8.                     m_MovementAudio.clip = m_EngineIdling;
    9.                     m_MovementAudio.pitch = Random.Range (m_OriginalPitch - m_PitchRange, m_OriginalPitch + m_PitchRange);
    10.                     m_MovementAudio.Play ();
    11.                 }
    12.             }
    13.             else
    14.             {
    15.                 // Otherwise if the vehicle is moving and if the idling clip is currently playing...
    16.                 if (m_MovementAudio.clip == m_EngineIdling)
    17.                 {
    18.                     // ... change the clip to driving and play.
    19.                     m_MovementAudio.clip = m_EngineDriving;
    20.                     m_MovementAudio.pitch = Random.Range(m_OriginalPitch - m_PitchRange, m_OriginalPitch + m_PitchRange);
    21.                     m_MovementAudio.Play();
    22.                 }
    23.             }