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

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

    jamiewhitephd

    Joined:
    Jun 8, 2012
    Posts:
    121
    After calling the play function and returning a sound result, how do you check if a sound variation is currently playing? This is to stop some sounds overlapping/being repeated over the top of it.
     
  2. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Code (csharp):
    1.  
    2. var sfx = MasterAudio.PlaySound3DAtTransform("Arrow");
    3.  
    Then later:

    Code (csharp):
    1.  
    2. if (sfx.ActingVariation != null && sfx.ActingVariation.IsPlaying)
    3. {
    4.       // it's already playing.
    5. }
    6.  
     
  3. jamiewhitephd

    jamiewhitephd

    Joined:
    Jun 8, 2012
    Posts:
    121
    Brilliant, thanks for this. Apologies for my obvious in-observance.
     
    jerotas likes this.
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Heads up! Just re-coded the Random variation code. Now it does "never-repeat" by default! Before it had a chance to repeat every time it refilled the random pool when it was empty. The next version will have this.
     
  5. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hey @jerotas and everyone else.

    Droping by to let you all know that Master Audio now has integration with NodeCanvas :)
    You can download the tasks here.

    Cheers and have fun!
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Awesome Vuverian! I'll update our materials to point out integration with NodeCanvas :)
     
  7. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Thanks. I've done the same.
    It's Nuverian by the way ;)

    Cheers!
     
    jerotas likes this.
  8. ilesonen

    ilesonen

    Joined:
    Sep 11, 2012
    Posts:
    49
    Hi Jerotas,
    Is it possible and how to connect single playlist track to Unitys audio mixer? The whole playlist was easy to integrate but I'd like to adjust tracks separately.

    Thanks!
     
  9. dean0

    dean0

    Joined:
    Mar 7, 2014
    Posts:
    8
    Master Audio doesn't seem to compile with Unity 5.1
    I think it needs UNITY_5_1 defines.
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Just make a Playlist with one clip. Then tell the PlaylistController that hosts it output to a Unity Mixer Group. Is there something I'm missing?
     
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    That was fixed in V 3.5.7.8. However, I found a couple other compile errors on 5.1 and will submit a fix immediately.
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Master Audio V 3.5.8.1 has been submitted to the Asset Store. Changelog:

    • Added a button on Master Audio Manager window to delete all persistent settings and other settings stored in PlayerPrefs.
    • Added a Song Id field to each song in a Playlist. This allows you to play songs in different Playlists by a common alias like "Intro", "Battle Music" etc when you use different music for audio skins or levels.
    • Removed preview buttons for all audio in Master Audio prefabs viewed in Project viewed because they can't work there anyway.
    • Added ability to have Sound Groups to trigger a Custom Events when played.
    • Added option in Visual Settings to show buses (bus dropdowns) in narrow mode. Defaults to on.
    • Added NodeCanvas integration package.
    • Added true no-repeat functionality (by default) to Sound Groups with randomized Variation Sequence.
    • Fixed bug: previewing of Internet Files didn't do anything.
    • Fixed performance bug: Playlist clip would be scheduled even when current clip is looping (not necessary).
    • Fixed compilation errors on Unity 5.1
     
  13. ilesonen

    ilesonen

    Joined:
    Sep 11, 2012
    Posts:
    49
    Ok, that way I was also thinking first. I was just wondering if there is some other way because I have 60 tracks on playlists so it would be lot of work to change them to single track playlists. Anyway, thank you for the support!
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    If you need the Playlist Controller features (crossfading / ducking / gapless transitions / multi-layer synchronization), then you'll need to use Playlists. You can use either regular Playlists or Dynamic ones (courtesy of Dynamic Sound Group Creator).

    If you don't need any of that and just want to play some music, you can put the music into Sound Groups and play them like sound effects. And then you could put them all into one Group if you like. Although I would advise using Resource files because that will take up a LOT of memory otherwise (read our best practices section in the readme for some un-obvious tips).
     
  15. ilesonen

    ilesonen

    Joined:
    Sep 11, 2012
    Posts:
    49
    Layered sync is key feature in my app so use of playlists is necessary and also resource files are in use. Thanks for the tips, I'll check on those files. ;)
     
    jerotas likes this.
  16. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    410
    Hi, I see this fix in the new version, but it's still 3.5.8 in the asset store today
    How long will it take usually?
    • Fixed compilation errors on Unity 5.1
     
    Last edited: Jun 11, 2015
  17. KayaOrsan

    KayaOrsan

    Joined:
    Jan 22, 2013
    Posts:
    20
    Are there any plans for being able to parent buses? I'd love that.
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Usually takes 3-4 days. This is about day 2. If you don't want to wait for Asset Store approval, email us with your Asset Store invoice and we'll send you the download link to the newest.
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
  20. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    410
    Yes, sent to support[AT]darktonic.com, is it right?
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Yep, just replied to your email with the latest.
     
  22. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    410
    Hi, I just upgrade but it pops an error ma3581_error.png
    So I add an #if around that line, I think it should be fine, right?
    Code (CSharp):
    1. #if UNITY_EDITOR
    2. using UnityEditor;
    3. #endif
     
    Last edited: Jun 12, 2015
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Yes, I just made that change last night, for the next update. Note that it only happens when exporting to certain platforms (PC standalone for sure).
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Had to make a hotfix for 2 issues. Submitted to the Asset Store.

    V 3.5.8.2

    • Fixed compile error when exporting as PC standalone and some other platforms.
    • Removed accidental logging code left in no-repeat random refactor from V 3.5.8.1.
    As normal, if you need the latest and don't want to wait, email support@darktonic.com with your Asset Store invoice.
     
  25. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    410
    Hi, MA keep popping something in the console, am I doing anything wrong? It doesn't log like this before last upgrade.

    ma_log.png
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    That was a loop for testing that I forgot to take out when making no-repeat randomizations for V3.5.8.1. I submitted a hotfix of V 3.5.8.2 to fix this and one other issue. This is mentioned in the post above yours :)

    If you'd like the hotfix without having to wait, email me at support@darktonic.com

    Thanks!

    P.S. for that particular issue, you can just delete the 3-5 lines of code that log the integers, from the line number in the Console window. It's a for loop.
     
    Last edited: Jun 15, 2015
    zhuchun likes this.
  27. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    446
    Hello. I'm getting this error when trying to build for Android:

    Assets/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs(1,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?
     
  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    It's fixed in V 3.5.8.2, mentioned a few posts up.

    Email me at support@darktonic.com with your Asset Store invoice if you don't want to wait for Asset Store approval.
     
  29. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    446
    Sorry, didn't see that issue mentioned earlier. Thanks for the quick response.
     
    jerotas likes this.
  30. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    The next update will allow Synchronized Playlists to auto-advance! Only if crossfade is not used, as crossfading would cause a lot of unsolvable bugs.

    A few people have been asking for this, so I made it a priority.
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    The next version of Master Audio will have automatic support of the "Preload Audio Data" checkbox on Audio Clips that was added for Unity 5. This can be used as an alternative to Resource Files and saves on total audio memory used. Extremely beneficial for large playlists so that you don't use audio memory for all songs all the time!
     
  32. Craig87

    Craig87

    Joined:
    Feb 17, 2014
    Posts:
    6
    Hi jerotas, I just bought Master Audio and am trying it out on my game. After reading your documentation I tried out a Mechanim State Transition event when a Spider mob in my game dies. When testing my event, I hear it about 50% of the time when I kill my Spider mob. I attempted to remove all other audio sources from my scene in case that was the issue, but still only hear the sound event about 50% of the time. I messed around with the Mechanim Controller to see if that made a difference but found nothing I changed made a difference. Any ideas? Thanks!
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    When the Spider mob dies, does it play a death animation before despawning? If not, that's not expected to work.

    As far as "hearing" the sound 50% of the time - make it a 2D sound temporarily to make sure it's not just too far away from the Audio Listener. You can also turn on "Log Sounds" in the Master Audio game object Inspector in the Advanced section and it will tell you if the sound was indeed played or not. Log Sounds will also tell you diagnostic things like if the Sound Group doesn't have enough non-busy Variations to play a sound, which may be happening.
     
  34. Craig87

    Craig87

    Joined:
    Feb 17, 2014
    Posts:
    6
    Hi Jerotas,

    The spider mob does not disappear before playing the death animation.
    Changing to a 2D sound did not solve the issue, so it looks like my audio listener is in range.
    Turning on logging, I see the following messages when I kill the spider. Looks like I must have a silence variation for my scream that is getting played?
    upload_2015-6-25_20-31-14.png

    Looking through your documentation on where to set variations I read "Click the gear (settings) icon on the mixer row for Blast. It will now take you to the Group settings. " I can't seem to find this gear settings on my scream, is it because of the narrow message below that the gear does not appear?

    upload_2015-6-25_20-43-26.png

    Thanks!
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Yes, in narrow mode there's no gear icon (although I put it back for the next update). It sounds like you used a Group Template like "25% play", so it's behaving as it should. Go examine the child Variations of the Sound Group and delete the "silence" one if you didn't want that.
     
  36. Craig87

    Craig87

    Joined:
    Feb 17, 2014
    Posts:
    6
    Excellent, working now that I removed the Silent variation. Thanks for the debug. Nice to see the "Log Sounds" feature.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    No problem. You'll want to select a more normal Sound Group template before creating more Sound Groups, such as "Default Single" so you don't have more unintended silence. This is selected from a dropdown above the Mixer section.
     
  38. Craig87

    Craig87

    Joined:
    Feb 17, 2014
    Posts:
    6
    Hey jerotas,

    I am having difficulties enabling Footstep sounds in my game and need some direction. My game has a first person player with a character controller that is walking around a Unity terrain which has a the Layer=World.

    For my scene, is it possible to use your "Footsteps Sounds.cs" script or should create my own code logic for triggering the footstep sounds?

    I've tried using your Footsteps Sounds.cs script by trying both events "On Trigger Enter" or "On Collision" and then setting the layer to "World" but the footstep sound group I added never gets played. I turned on the Sound Logging and no events are logged. It seems like I need to create my own logic for triggering the audio because the events "On Trigger Enter" and "On Collision" aren't really what a character controller is doing when it moves across the terrain. But, before I start writing code, I wanted to hear your opinion on the path I should take.

    Thanks!
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    You'll probably have to add colliders and/or possibly rigidbodies to the Terrain to get OnTriggerEnter and OnCollision to fire, which is what FootstepSounds.cs uses.

    As in normal Unity, a collision only calls those methods when both objects have a collider and a rigidbody, and one of the rigidbodies has to use gravity.

    If there is some other MonoBehavior event besides those listed above that we should be using that would work with your scenario, let us know what it is.
     
  40. Craig87

    Craig87

    Joined:
    Feb 17, 2014
    Posts:
    6
    Got it. I don't think there is any event MasterAudio could when using a Character Controller. There would be a collision when the controller first collides with the terrain, but as the Character Controller moves across the world, there is no event for MasterAudio could use to trigger with. Thanks, I will create my own logic for this.
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Understood. We don't use terrain in our games so I'm not sure if there's a good way to do what you want.
     
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Master Audio V 3.5.8.3 has been submitted. Changelog:

    • Added fix for NGUI OnDrag and other events.
    • Added ability for Synchronized Playlists to use auto-advance if Crossfade is set to zero.
    • Narrow / Normal mode is now stored in Player Prefs so you don't have to make the change on each Master Audio prefab if you have many.
    • Fixed bug: In Narrow Mode on some Inspector widths, can't type in top 3 boxes (Master Playlist Volume etc).
    • Added ability to automatically unload Audio Clips marked with "Preload Audio Data" off (default is on) used in Playlists. Saves a ton on memory usage without having to use Resource Files!
    • Added ability to automatically unload Audio Clips used in Sound Groups. Saves a ton on memory usage without having to use Resource Files!
    • Added property ClipsRemainingInCurrentPlaylist to PlaylistController for reading the number of songs not yet played.
     
  43. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    410
    Hi, I'm using MA to handle characters speech(groups/variations). Players may click fast to skip it, how to stop or fade previous PlaySound() before next comes?

    Another thing is what's the best practice if we have to handle hundreds of NPC? Put all sentences in one MA prefab will make the list very long in the inspector. Is a scene have multiple MA prefabs an good idea? Any other way instead?

    Thanks!
     
    Last edited: Jun 29, 2015
  44. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Multiple MA prefabs will not work, you can only have one. It may be very long in the Inspector, but you can collapse the Inspector so you don't have to look at it. Instead of adding them all at once, you can use Dynamic Sound Group Creator prefabs attached to the NPC so that when they spawn, their Sound Group gets added to Master Audio, and when they despawn it goes away.

    We normally make a Sound Group for each character that will have dialog, with Variations for each thing they say. Then you make the Sound Group's Variation Mode "Dialog" so it will automatically stop or fade the previous sentence if you play a new one. Whatever you configure there. You can also put several characters' dialog through a bus with voice limit of 1 and "stop oldest" checked. No previous clip fade is available with that though.
     
    zhuchun likes this.
  45. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    410
    Wow, THANKS! Very helpful guideline!
     
    jerotas likes this.
  46. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,042
    Great job on the auto advance, ty!

    Any timeline on the "0) Add a "repeat count" for Playlist songs. Should respect the count and let the song loop X times even if shuffle is on." ?
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    Well it's at the top of the list, but I'm about to do "not much of anything" for a couple months probably. I have twins about to be born in 1-4 weeks.

    If I have time to get to it before then, it will be nice. Otherwise it will be a bit of a wait.
     
  48. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,042
    jerotas likes this.
  49. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    235
    Hi Brian,

    Firstly congratulations on the imminent arrivals. Development is hard with children. I have three girls myself - your life is about to change in a huge way :)

    Loving your products. We purchased them years ago, but I forgot about them until recently lol.

    I am having an issue with persisting across scenes. I have the MA and Playlist in my bootstrap scene, which is working perfectly on runtime.
    1. My problem is in editor whilst in development. I understand about needing to place a non persistent MA and playlist in your scene. The documentation states that during runtime if the persistant MA and Playlist encounters your "development" MA and playlists they will be destroyed keeping the persistant ones. While this seems to work for the MA, the playlist is not being destroyed and causes more than one playlist in your scene error. We only ever have one playlist game object in our game (from the bootstrap scene) and use Dynamic Sound Groups to populate with sounds and music for the scenes so our code always uses OnlyPlaylistController.
    2. My second problem is with Dynamic Sound Groups. The sound group aspect work perfectly, my problem is with the Playlists. Is there any reason you can't add to an existing Playlist inside the Playlist Controller? If you put the same name inside the DSG they playlist items just don't get added. Putting a different name means you have to change playlists which stops the nice cross fades because you need to call change playlist.
    I think that is everything for now.

    Thanks again for a great product,

    Justin
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,161
    #1, may not work after we added the ability to have multiple Playlist Controllers. Perhaps the documentation is out of date. Or perhaps there's an error there. What exactly is the error being logged in the console? Can you paste it here?

    #2, Can't add to an existing Playlist because of the way Playlists already being hosted by a Controller are kept track of for auto-advance purposes. It can't be modified after started. Hopefully, you get an actual error when you try to add a Playlist of the same name? If not, I should add that.
     
unityunity