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
    I assume that you're saying in the next (non-menu) Scene, it didn't load Spanish.
    Do you have a separate Master Audio prefab in the non-menu scene? If so, that worked properly when I tried it. You are setting the "DynamicLanguage" with a script when the user selects it, right?

    Let me know steps to reproduce or go ahead and send me a small project to reproduce the problem.
     
  2. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    No, I don't have a separate Master Audio prefab in the non-menu scene.

    That may be the issue then. But what script do I attach to it?

    Thanks
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    What script to you attach what to?

    The Master Audio prefab will only load up the localized resource file map during its Start event. But the Start event only happens in the first Scene of that MA prefab. If it persists to the next Scene, Start never gets called again so it doesn't get a new map.
     
  4. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Before I drive you crazy...

    How could I pass the language value in this if statement:
    Code (CSharp):
    1. void Awake()
    2.      {
    3.          DontDestroyOnLoad(gameObject);
    4.          if(PlayerPrefs.HasKey("CurrentLanguage"))
    5.              Options.CurrentLanguage = (Language)PlayerPrefs.GetInt("CurrentLanguage");
    6.          else
    7.              Options.CurrentLanguage = Language.English;
    8.          if(PlayerPrefs.HasKey("VoiceOverVolume"))
    9.              Options.VoiceOverVolume = PlayerPrefs.GetFloat("VoiceOverVolume");
    10.          else
    11.              Options.VoiceOverVolume = 1.0f;
    12.          if(PlayerPrefs.HasKey("BackGroundVolume"))
    13.              Options.BackGroundVolume = PlayerPrefs.GetFloat("BackGroundVolume");
    14.           else
    15.              Options.BackGroundVolume = 1.0f;
    16.  
    17.          Instance.isDirty = false;
    18.          InvokeRepeating("SlowUpdate",2,2);
    19.         LanguageCheck();
    20.      }
    I thought that by adding LanguageCheck() everything would be solved but it only works when app first loads. Yes I do have a Master Audio prefab in Main Menu (which tells me: Dynamic Language currently set to: French) and also the Shapes scene, but this value won't be passed if you return to the Main Menu, change to a different language (say German) and come back to Shapes scene. In such case the language played will still be French and not German.

    LanguageCheck():

    Code (CSharp):
    1. public static void LanguageCheck()
    2.     {
    3.         switch (CurrentLanguage)
    4.         {
    5.             case Language.English:
    6.             {
    7.                 MasterAudio.DynamicLanguage = SystemLanguage.English;
    8.                 break;
    9.             }
    10.  
    11.             case Language.Spanish:
    12.             {
    13.                 MasterAudio.DynamicLanguage =  SystemLanguage.Spanish;
    14.                 break;
    15.             }
    16.  
    17.             case Language.French:
    18.             {
    19.                 MasterAudio.DynamicLanguage =  SystemLanguage.Spanish;
    20.                 break;
    21.             }
    22.  
    23.             case Language.German:
    24.             {
    25.                 MasterAudio.DynamicLanguage = SystemLanguage.German;
    26.                 break;
    27.             }
    28.  
    29.             default:
    30.             {
    31.                 MasterAudio.DynamicLanguage =  SystemLanguage.English;
    32.                 break;
    33.             }
    34.         }
    35.     }
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    What scene is that script in? And why are you telling Unity to "DontDestroyOnLoad"?
     
  6. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    This loads in every scene automatically....

    And I didn't write this script, the guy who wrote the first scene; Alphabet did.

    Should I remove that line?
     
  7. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    if a script is "dontDestroyOnLoad", then it needs to be in the bootstrapper scene only, or it needs to detect when there's another copy already persisting, so there are never more than one.

    If neither is true, then I bet your Awake event is only firing in the first scene, meaning LanguageCheck doesn't actually run the 2nd time you get to main menu.
     
  8. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    I disabled dontDestroyOnLoad() and it didn't make any difference. In fact it didn't even load LanguageCheck because it didn't load the chosen language the first time app loaded. It defaulted to 'Default Language' which is English.

    What am I going to do!?
     
  9. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I guess you're going to send me your whole project then. Guessing around isn't working out so let's not waste any more time on it. Send me your project with filemail.com
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Or please tell your scripter to re-write the script in a way that actually executes the LanguageCheck each Scene, even when you go back to the menu scene for the 2nd time (I'm guess that's not happening, he could verify).
     
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    We found the bug in localization. It is fixed and will be in the next update.
     
  12. SeTHBeaRzz

    SeTHBeaRzz

    Joined:
    Jan 8, 2014
    Posts:
    35
    Hi there,
    I've encountered a problem while using Master Audio.

    So here's how I setup my enemy walk sound.
    I've made a Enemy Sound Group with Attacking, Walking, Death, etc...
    each with its own variation name.

    Next I setup custom events on Master Audio GameObject on scene.
    for example "E_Walking" is the event name.

    I've attached the Event Sound script to my enemy prefab and setup the custom events accordingly.
    The way I fire the custom event is through using MasterAudio.FireCustomEvent, everything else I didn't mention remains in default settings.
    and MasterAudio.FireCustomEvent( "E_Walking" ) is called through an animation event setup along the enemy's mecanim animation timeline.

    walking sound plays, but when there's 2 or more enemies spawned at the same time, only 1 of the enemy will actually play the walking sound, the rest remains silent.
    I have no idea why this is the case, I've tried every MasterAudio.PlaySound variations but gotten the same results.

    P.S. : I'm using Master Audio: AAA Sound Solution v3.5.4.6
     
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Usually when only one of a Variation will play, it's because you've left the default "weight" of that Variation at 1. The weight is the maximum of that Variation that can play simultaneously (unless you set another limit on top of that via bus voice limit or polyphony voice limit). So if the weight is still 1, increase the value to the desired maximum of that sound you want to allow to play at the same time. If it's already more than one, turn on "Log All Sounds" in the Advanced settings and it will tell you the other reason that the Variation is being limited during runtime (bus limiting, polyphony, etc).

    -Brian
     
  14. SeTHBeaRzz

    SeTHBeaRzz

    Joined:
    Jan 8, 2014
    Posts:
    35
    Thanks for the guide, It solved my problem.

    Keep up the great work XD.

    - SeTH
     
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Any time.
     
  16. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Hi, I updated to latest. I couldn't find the int based access anymore, everything is string now?
     
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The performance of the object I used for that was terrible (it was called out), so I remove that object and the int access. If you go back in the release notes you can find the last version that had it somewhere.
     
  18. MightyRabbit

    MightyRabbit

    Joined:
    Aug 8, 2012
    Posts:
    27
    Hey - I'm working on setting up the music system for our game and I've currently got two Playlist Controllers - I need to be able to pause one (and maintain the song position) while resuming/starting the other one. I've tried to implement this in the only way that makes sense (calling ResumePlaylist and PausePlaylist on each of the controllers) - but PausePlaylist seems to stop the playlist, not pause it. Even when I click the pause button on the master audio prefab, the controller stops instead of pausing. What am I doing wrong here? Is this a bug?
     
  19. hexdump

    hexdump

    Joined:
    Dec 29, 2008
    Posts:
    443
    Hi,

    Does master audio has any built-in functionality to read data from a playing clip (to link music playback to game events) and frame independent sync? I need to have some objects doing things at some beat measure (2,4,8) and then make other things appear based on the audio data being played.

    Thanks in advance.
     
  20. MightyRabbit

    MightyRabbit

    Joined:
    Aug 8, 2012
    Posts:
    27
    A follow up to my issue, I'm able to pause and resume the first playlist in my list of playlists. Any additional playlists completely stop when I try to pause them.
     
  21. MightyRabbit

    MightyRabbit

    Joined:
    Aug 8, 2012
    Posts:
    27
    Scratch that, I can only pause looping tracks in the first playlist. Is there a particular reason for this? Am I missing some kind of setting I need to check?
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If you are using resource files, make sure you've checked "keep pauses resources" in the Advanced section in Master Audio. If you aren't using resources let me know and I'll check it out.
     
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No. And unfortunately no plans to add beat syncing features. There is another plugin that does exactly that, but it also doesn't do pretty much everything that Master Audio does.
     
  24. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I just wanted to let all Master Audio users know that the latest Behavior Designer release includes support for Master Audio. I've created a set of tasks which allow you to control Master Audio from within a behavior tree. These tasks are similar to the Playmaker actions already available. In addition, there is a small sample project available which should help you get started using these tasks.
     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Awesome Opsive! We'll also be including your sample projects with our plugin so people can check it out.
     
  26. MightyRabbit

    MightyRabbit

    Joined:
    Aug 8, 2012
    Posts:
    27
    No, they're not resources - I've got them in an Audio folder and am assigning them manually to the Master Audio prefab. I tried turning on "Keep Paused Resources" just for kicks and it didn't fix the issue. I can't pause any tracks on a second PlaylistController or pause any non-looping tracks on the first PlaylistController.
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I assume you're unable to make it work via code? Or are you using Playmaker or EventSounds to pause the controller?

    Also, does pausing work properly in the Jukebox? Are you using the same playlist on both controllers? Lastly, how is your song transition mode set up for both playlists?
     
  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio V 3.5.4.7 will be live in 20 minutes! Changelog:

    • Added Caller Despawned Mode setting to Sound Groups. The options are: None (default and old behavior), Stop and Fade Out. This allows you to control what happens to a Variation that is still playing when the object that "made the sound" is destroyed or despawned. Previously it would continue to play until the clip was over (or forever if looped).
    • Fixed localization bug where you could only switch languages once.
    • Fixed Playlist Controller bug where there was a race condition starting the playlist via API and letting it initialize itself in the Start event.
    • Added Behavior Designer demo version (includes full conversion of all Master Audio Playmaker custom actions!) as an optional package in the 3rd party folder.
     
  29. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    138
    Yeah, now we have full Behavior Designer integration! That's our new favorite plugin :)
     
  30. MightyRabbit

    MightyRabbit

    Joined:
    Aug 8, 2012
    Posts:
    27
    I've tried pausing with code and the Jukebox, and got the same results.

    We have two playlists:
    1. Music (two tracks here: one looping, one non-looping)
    2. Planning Mode Music (one track here that loops)

    We then have two playlist controllers:
    1. Music
    2. Planning Mode Music

    Each playlist controller plays it's respective playlist. The only track that can currently be paused is the looping track on the music playlist. If I switch the ordering of the playlists, I can then successfully pause the planning mode track, but the music playlist won't pause anymore.

    The song transition type on both playlists is "New Clip From Beginning".
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I can't reproduce the problem in my example Scene. Everything pauses and unpauses fine. You will need to send me a small project that reproduces the problem and I'll take a look.

    -Brian
     
  32. ojuzu

    ojuzu

    Joined:
    Jun 29, 2006
    Posts:
    67
    Hi Brian. I had a couple of questions/issues I'm hoping you can shed some light on.

    First: What kind of curve are you using for the playlist volume control? I'm asking because when lowering the volume, it seems like the perceived volume of the playlist music is not noticeably quieter until it gets close to .5 and then it seems to start getting quieter exponentially. So the difference between .15 and .25 is a lot more substantial than it is between .6 and 1 for example. Am I hearing things or ?! ;)

    Secondly: Any idea why a sound might be appearing quieter and panned slightly left after adding as a new group? I have a set of sound fx all from the same library and so compression and all that is very similar. If I preview the sounds by auditioning them on the sound asset itself in Unity they both sound loud and panned dead center. But when I add them to masteraudio, one of the sounds continues to sound pristine and the other is quieter and panned to the left. Very very strange. Import settings are the same and all other settings seem to be normal. Any idea why this might be happening? I've been adding sounds for the last week and they've all been great until last night.

    Thanks in advance for any help you can offer.

    Dennis
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I don't notice what you're talking about with my playlists. It's just the normal "whatever Audio Clips use" curve. Which volume slider are you using? The Playlist Master Volume or the individual Playlist volume?

    Second issue: what location are you playing the sounds at? Are you passing a Vector3 for position, playing them at the position of a Game Object, or providing no position? If it's "no position" they will be played at the position of the Master Audio prefab itself, which usually is not what you want.
     
  34. ojuzu

    ojuzu

    Joined:
    Jun 29, 2006
    Posts:
    67
    In this case I'm using the Playlist Master Volume slider. I have used the individual playlist slider as well and that seems slightly less sensitive. I'm not sure if there's any advantage/disadvantage to using one or the other. I will be allowing the player to adjust the FX and music volume so I assumed using the main slider would be a better choice. I'll try some different music and see if the sensitivity is any different.

    In this instance I'm just pressing the preview buttons in the MasterAudio groups list. The sounds are 3D and played from a Vector3 in game. It's less noticeable in game other than the fact that the sounds are quieter than I'd like. But the difference when previewing is quite substantial.

    If nothing is jumping out at you as to a potential cause, I'll try a few more tests.
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The Playlist Master Volume is to adjust all playlist volumes at once. If that's what you want to do, then us it. Otherwise use the individual playlist volume.

    2nd issue: If you're just previewing, those are playing from the position of the Master Audio prefab. If you want that to be centered, it would need to be at about the same coordinate as your Scene's audio listener. If your audio listener moves around (attached to your player for instance), there's no good way to do that. Otherwise just move the Master Audio prefab to a different place (i.e. similar or same X/Y/Z as the audio listener).
     
    Last edited: Aug 7, 2014
  36. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    Two questions. I've used Master Audio for a while, and for the most part it works great. Note I don't use any of the built-in sound group support through the editor. I dynamically create all my sound groups at load-time. However, I have two issues:

    1) Where do I put the MasterAudio prefab? I've always thought I should parent it under the camera - this is something I thought I had read in order to get the 2D sounds to work. However, I've noticed 3d sound attenuation never seems to work quite right or at all, and I noticed the other day that since the sounds are cached and played under the master audio root, they inherit the transform information from essentially the camera. I checked the audio variations that my stuff created in MasterAudio and everything looked fine in terms of falloff, etc.. Should the prefab be located somewhere else?

    2) For a while now, the first sound of each type that I play is just static. Usually these are very short sound effects. After the first sound instance plays all sounds of that type works fine after that. Any ideas?

    Thanks!
    Kirk
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    #1, You should put the Master Audio prefab under nothing. It should be top-level with no parent. It may in fact work as a child, but we don't support it as there may be some bugs working it with that way (pretty sure there are).

    It doesn't matter where the Master Audio prefab is positioned except that its location will be used for previewing sounds. Normally you tell Master Audio the position to play every sound at during runtime, unless you're using 2D sounds, in which case it doesn't matter at all where the prefab is. We haven't seen any fault in 3d attenuation and it works fine on our games. I mean that sounds playing further away from the Audio Listener are quieter. If you have put your MA prefab under the camera (which you shouldn't) it's possible your sound-making objects are just too close to the Audio Listener so you get little to no volume falloff.

    #2, I have not had that problem at all so I don't have a clue. Anyone else had that experience? If so, what caused it?

    Does your audio listener move or is it always in the same place? A moving one can cause weird audio problems.
     
  38. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    Yes, this worked, except 2D sounds are not playing now.

    Moving them to the root fixed both attenuation and the static issue (except the 2D sounds stopped working).

    As I was writing this post, I realized that I had to change the audio clip to "2D", and the 2D sounds started working. Meh. Not a huge fan of that, but I guess that is Unity. I don't like having to specify how a sound will be used at design-time rather than run-time. This is not really a MasterAudio issue though.

    Edited: Can you add a check in when logging to see if PlaySound2D variants are called on an AudioClip that is not set to 2D? (and vice versa)? This would seem useful if this constraint on the audio clip is required for the sound to play correctly.
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Would you like us to log a warning if this happens, or what? I don't necessarily want to restrict users from playing 3d sounds without specifying a location if they want to do so.
     
  40. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The cool plugin AI for Mechanim has just added support for Master Audio and Core GameKit too! Now you have several choices for your no-code programming with our plugins! Playmaker / Dialogue System / Behavior Designer / AI for Mechanim / built-in Dark Tonic rich scripts!

    Enjoy :)
     
  41. michaelmei81

    michaelmei81

    Joined:
    Aug 9, 2014
    Posts:
    11
    Hi jerotas,

    Thanks for such great sound plugin!

    We are making a music game which needs to play lots of different short sound notes concurrently and even the same note sound(s) frequently, say in every few ms (for instance, some classic songs).

    Just wondering does it support sound pooling and playing same sounds frequently? Just like SoundPool API in android?
    And also will this plugin deal with unity3d's delay playing of the sounds on android and ios platform?

    Thanks in advance.
    Michael
     
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Everything is fully pooled (all objects are created up front when the Scene starts). As long as you don't use Resource files (those cause a latency because they have to be loaded and unloaded) we've seen little to no latency on iOS and Android, however this in no way gets around any Unity limitation because we are using Unity's Audio Source and Audio Clip components behind all the fancy UI.

    Make sure to set your Audio settings to best latency but as I said we've never noticed any latency on our games and our devices.
     
  43. michaelmei81

    michaelmei81

    Joined:
    Aug 9, 2014
    Posts:
    11
    Thanks for the suggestion, Jerotas.
     
  44. awejk

    awejk

    Joined:
    Oct 13, 2012
    Posts:
    32
    for each call
    MasterAudio.PlaySound(Const.SOUND_APPLE_CUT);
    takes 0.5kb, Why so much?
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    0.5kb of what? Where are you getting that number?
     
  46. awejk

    awejk

    Joined:
    Oct 13, 2012
    Posts:
    32
    memory, of course.
    I very much hoped that mobile platforms will be some optimization, but unfortunately the same situation. This screenshot is made when the application was launched on Android.

    I used tags Profiler.BeginSample(..) and Profiler.EndSample() to better identify the problem areas.
    I'm afraid to mention EventSounds - for each sound played takes 1.1 kb of memory. That makes not used for mobile platforms.
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you for the info. Most of our users do target mobile (and so do we), and no one has reported any problems from this. I did go through and optimize the code to execute faster a few months ago, but there are simply a lot of checks that Master Audio needs to perform before playing sound, based on dozens on limits and controls. Some of those take up GC memory indeed.

    Our newest game has about 90 Sound Groups and runs without a hitch on all mobile platforms. I would urge you to give it a shot anyway, and I believe you'll find that it does work fine.
     
  48. awejk

    awejk

    Joined:
    Oct 13, 2012
    Posts:
    32
    If you look at the top-end devices, then of course it will work fine, but when you consider all phones supports arm7, I think there will be problems with a similar number of groups. Now we have about 20 groups and simultaneous playback 3-5 sounds that are already visible small lags
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That's fairly extreme to assume that we only test on top devices. I'm a little offended by the statement to be truthful :(

    We actually don't own any top-end devices or test on those. All our devices are 2-3 years old, and that's on purpose. We mainly test on iPad2, iPhone 4 and Samsung S3. The S3 is a little newer than the others but none of these are by any means top end. And we have seen no noticeable latency on any of these. Except when loading Resource files, but that is to be expected because the audio file has to be quickly be loaded into memory first before it's played.

    Anyway, it sounds like you're describing latency - if it's not then please rephrase. I also feel the need to mention that garbage collector memory used has nothing to do with latency, just in case you are not aware of that. Are you using Android, iOS or another platform? It's known that Android has a certain latency on some Android devices that just comes from "using Unity". And since we're using the same Unity audio engine under the covers (not replacing FMOD) we cannot fix that on whatever devices that occurs on. However I've never seen it on our relatively subpar devices.

    However, it can usually be remedied by changing audio settings in Unity for best latency. Have you done that? I don't believe it's the default.
     
    Last edited: Aug 11, 2014
  50. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    393
    Hi,

    I'm having lots of problems loading scenes due to the amount of AudioClips in the Hierarchy - as I understand each AudioClip has to be loaded into memory when the scene starts up and due to the large amount of clips I get an 'Out of Memory' crash. Would Master Audio help alleviate this in any way or would I need to setup my own audio streaming/loading from resource solution?

    Thanks!