Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi there,
    I've encountered a little problem with master audio:
    I set Time.timeScale to 0 when my game's pause menu opens, then I found all the menu button's sound does not play at all.
    I use master audio's sound event on my buttons, the event fired correctly but the sound does not play, actually all sound buses does not play when the time scale is zero.
    I've checked the "Ignore TimeScale" check box on the top of master audio's settings, but no helps.
    Anyone knows how to set a certain bus ignore timescale for real?
     
  2. nesta219

    nesta219

    Joined:
    Nov 3, 2015
    Posts:
    14
    Hello,

    I'm experiencing an issue with MasterAudio in my current project using Unity 2017.3.0f3 . I've imported Zenject, the AWS SDK, and XMLLayout to my project already. I'm able to import the MasterAudio package, but as soon as I focus on the MasterAudio prefab in the hierarchy window, I get a slew of console errors, which makes me think something is up with the editor scripts:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. DarkTonic.MasterAudio.MasterAudio.DoneRescanningGroups () (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:7409)
    3. MasterAudioInspector.ScanGroups () (at Assets/Plugins/Editor/DarkTonic/MasterAudio/MasterAudioInspector.cs:4630)
    4. MasterAudioInspector.OnInspectorGUI () (at Assets/Plugins/Editor/DarkTonic/MasterAudio/MasterAudioInspector.cs:160)
    5. UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1245)
    6. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    and

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. DarkTonic.MasterAudio.MasterAudio.get_ShouldRescanGroups () (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:7414)
    3. MasterAudioInspector.ScanGroups () (at Assets/Plugins/Editor/DarkTonic/MasterAudio/MasterAudioInspector.cs:4584)
    4. MasterAudioInspector.OnInspectorGUI () (at Assets/Plugins/Editor/DarkTonic/MasterAudio/MasterAudioInspector.cs:160)
    5. UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1245)
    6. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

    Any idea what's going on?
     
  3. nesta219

    nesta219

    Joined:
    Nov 3, 2015
    Posts:
    14
    Oh and for the record, I love this plugin and I've used it to great effect in the past. It's the best solution for audio as far as I'm concerned :)
     
    stevenatunity likes this.
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I will try and check if this happens to me tomorrow.
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Just answered you where you posted on our forum, same question.
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I did a test just now and the same as last time I tried, settings time scale to 0 does not affect the ability to play sounds, whether you're using a bus or not.

    So I can't reproduce what you're (not) hearing. You will need to send me a project that reproduces the bug or I can't figure out what is happening.
     
  7. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Sorry for my unchecked report.
    I've found the source of my problem and it's caused by my own mistake.
    Sorry again :/
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I've been getting a lot of these lately haha, no worries! Glad it's working.
     
  9. ldhongen1990

    ldhongen1990

    Joined:
    Dec 18, 2015
    Posts:
    61
    Hi jerotas are you guys rolling out an update on MasterAudio for Unity 2018 soon? I manually fixed a few compiler errors regarding "deprecated libraries and missing #if UNITY_2018" but will love an official update because I am not sure if my patchwork is entirely clean for production. Cheers
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Actually we didn't need to. The last update for 2017 compile errors took care of it. However, the Asset Store window in Unity 2018 doesn't let you update anymore from the Master Audio page so you may have thought you were on the latest when you aren't. The "My Downloads" page will let you get the newest and you'll be set!
     
  11. ldhongen1990

    ldhongen1990

    Joined:
    Dec 18, 2015
    Posts:
    61
    You were right! That was a mistake on Unity part, but thanks for the heads-up, any idea why they changed it? It's not as intuitive now
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I don't know but apparently they didn't do A/B testing of the feature before releasing it, which is the sensible thing to do when changing stuff. I do agree with you.
     
  13. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    How are you doing?

    Have a question regarding jukeboxes. I have 8 playlist controllers and when I adjust the position of the time position, on any playlist, it doesn't update the other controllers, they lose the sync even though the Song Transition Type is set to 'Synchronize Clips'.

    Basically I want to expose a slider so users adjust the time position of all the playlist controllers, but they need to be synchronized to the same time position in all of the playlists.

    Also, with this slider I want to grab the current time position and expose it in a label.

    Is that possible?

    Thanks again!
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No, the sample position is only checked when another song starts on a PlaylistController. It will look for another PlaylistController with a song playing in a Playlist of type "Synchronize Clips" with the same Sync Group and if it finds one it will use the same sample position to start at. Only at that time.

    So if you want that behavior you will need to loop through each PlaylistController with the same Sync Group and change its .timeSamples yourself manually with code. They will not automatically follow the sampleTime change.

    Also note that *any* changing of the sampleTime will sometimes make the "gapless transition" code (if you're using it) not perfect - sometimes a frame early and sometimes a frame late. This is actually not possible to fix due to math precision errors in Unity. I've tried for many days a couple different times and that's the outcome.

    Grabbing the current time, sure, that would be:
    Code (csharp):
    1.  
    2. var currentTime = PlaylistController.InstancesByName("PlaylistControllerName").ActiveAudioSource.timeSamples; // or .time
    3.  
     
    gegagome likes this.
  15. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Hi Brian
    Grabbing the timeSamples of a song on Start is showing an error (NullReferenceException: Object reference not set to an instance of an object), is that the correct behavior? A clip or audiosource needs to be playing in order for this value to be accesible, correct? I had a control AudioSource that was used for this purpose _controlAudioSource.clip.samples so I am wondering if I need to do the same.
    Code (CSharp):
    1. _slider.maxValue = PlaylistController.InstanceByName("playlist-name").CurrentPlaylistClip.samples;
    or
    Code (CSharp):
    1. _slider.maxValue = PlaylistController.InstanceByName("playlist-name").ActiveAudioSource.timeSamples
    Thanks
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Both of those properties you'd need to do a null check on. They can be null if the Playlist hasn't started yet or if no song is playing.

    Code (csharp):
    1.  
    2. var currentClip = PlaylistController.InstanceByName("playlist-name").CurrentPlaylistClip;
    3. if (currentClip != null) {
    4.    if (currentClip.samples > 0) // or whatever.
    5. }
    6. [LEFT][FONT=Helvetica][COLOR=rgb(51, 51, 51)]
    7. // OR
    8.  
    9. var currentSource = PlaylistController.InstanceByName("playlist-name").ActiveAudioSource;
    10. if (currentSource != null) {
    11.    if (currentSource.timeSamples > 0) // or whatever.
    12. }
    13.  
    14.  
    Start might be 1 frame too early.
     
    gegagome likes this.
  17. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    Hi,

    Having a desync issue with using the same audio clip across multiple overlapping audio sources, and was wondering if Master Audio might offer a solution.

    As an analogy, I'd like to use one sound system connected to 12 speakers that each broadcast the signal from the single sound system. My current method is more like using 12 unique sound systems, each playing the same sound clip from 1 speaker, but separately, which as you might imagine has been causing desync issues.

    Would Master Audio be able to help with this at all? Please advise.
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I wouldn't know where to start. I don't think Master Audio will help you at all there.
     
  19. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    So there's no way to have Unity play one instance of a sound file, but hear it from other "speakers" in the scene?
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Unity supports a single Audio Listener component, which is where sound is heard. There are (were?) a couple assets on the Asset Store that supported split-screen games that allowed 2-4 listeners somehow through trickery and time-switching, but it also cut in half the max number of Audio Sources that you can hear at once (normally 32) is how I understand it. We never built this functionality and don't plan on it. 12 Listeners? I don't think that has been done ever by anyone.
     
  21. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    Not Listeners.

    Was just wondering if it was possible to have Audio Sources using the same audio clip play as just 1 instance - each of them acting only as audio emitters - where by default 12 Audio Sources pointing to the same clip creates 12 instances. This is to get rid of desync. Experiment in sound, so apologies if I seem crazy ;)
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If I understand correctly, sure. Make sure your Sound Group has at least 12 voices, then use Event Sounds script on 12 game objects that listens for a specific Custom Event and plays that Sound Group. Then all you need to do is fire the Custom Event and they'll all play at the same time.
     
  23. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    Interesting. Looked at the docs, but not sure how to set up what I want. Would it be too much to ask for a quick example of how to set up an ambient sound that's heard from 3 voices that play infinitely when the level starts? I can email or PM my invoice.
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I don't think it would do any good to make you an example Scene. There's nothing to it, plus I don't know the particulars.

    A single "Ambient Sound" script will of course play a single voice, only while it's in audible range of the Audio Listener. So if you want 3 of them, put that script on 3 Game Objects and place them wherever you like. Make sure the Sound Group's Variation is set to "loop clip" so it will keep playing if staying in range. You said they "play infinitely" but a question to ask is: is the Scene large enough where you could be out of listening range ever? Ambient Sound will stop the sound when it's out of range and restart when back in range.
     
  25. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    Oh, I only meant text. The reason for "always on" is that it's important that whenever the audio listener is within listening range that the sound be at the same point in the clip as the other "voices". Otherwise everything would be out of sync when moving between these sounds.
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Then if you want it to not turn off when out of range, you'll have to make the MaxDistance of the Audio Sources large enough so they are never out of range.

    Or just use Event Sounds with enabled or start event instead of Ambient Sound script.
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    V 4.1.8 changelog:

    • Changed the default to not log to the Console when a same-named Master Audio or Playlist Controller is destroyed when you load a new Scene because you already had a persistent one. Also added a new setting to turn this back on for troubleshooting under Persist Between Scenes in Advanced Settings.
    • Fixed compile errors on UFPS integration.
    • Fixed AmbientSounds, the Audio Source was not moving to closest collider point if you had that selected.
    • Fixed bug with Ambient Sounds. Using "child colliders" did not follow the Audio Source.
    • Fixed bug where Master Audio Inspector would show no indication of what error was (duplicate Sound Group name) after the initial popup.
    • Added method MasterAudio.GetNextVariationForSoundGroup that only works for top-to-bottom Variation Sequence. It returns the AudioSource for the next Variation to be played.
    • Moved "Use Spatialize" Advanced Setting under a new heading "VR Settings", that now indicates the chosen Spatializer Plugin in the header.
    • Added support for Resonance Audio in Unity 2018+. Besides "Use Spatializer", there's now a new checkbox in VR Settings for "Spatialize Post FX" which will turn that checkbox on for all Sound Group Audio Sources at runtime. And there are buttons there to add Resonance Audio Source components to every Variation's or remove them, if you install the package mentioned next. Additionally, there's an optional package to install "MA_ResonanceAudio" that will make sure ResonanceAudioSource components get copied back and forth when using DGSC and Sound Group Organizers. Note that you will need to move the ResonanceAudio folder into Assets/Plugins to get this to compile though.
     
  28. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    I'm excited to start using Master Audio. However, I do have a few reservations about using this asset though. At first, I notice that the download folders are spread out across multiple folders rather than tucked away into a MasterAudio or author-specific folder.

    One of the major draws about the asset was that it advertised better memory management than the standard Unity audio system. These are big pluses for me. I will also be keeping an eye on how MasterAudio manages individual sound assets. What I mean is, I am always concerned about storing data in asset-specific components, where I don't have control over my own resources, such that if the asset wasn't installed or was corrupted, I essentially lose all the links to those sound resources.

    Anyway, I hope my reservations are baseless and I hope to make this an integral part of my game.
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There are 3 folders for a very good reason. The main folder is Assets/Plugins/DarkTonic/MasterAudio. The other 2 are "magic folders". I refer you to the same question asked on our forum, for a different plugin but the folders are the same.

    http://darktonic.freeforums.net/thread/760/organizing-folders

    Any plugin using Gizmos and/or UI-only graphics and not using those magic folders is flat out doing it wrong. There's even a stickied post on the Unity Asset Store forum illustrating why these are correct and should be used by all authors (though most authors still do not for some unknown reason). Here's that post:

    https://forum.unity.com/threads/whe...-scripting-packages-editor-extensions.292674/

    The plugin does not care where you put your audio assets, you can put them anywhere. Has that answered all your questions or not?
     
    Last edited: Jul 2, 2018
  30. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    It's answered most of my questions. The other part about sound resource management is more a comment on me trying out the workflow and gaining experience and identifying anything I don't agree with, but I can't say anything about that without trying it out first.

    For example, I have one specific question about scene loading. I have scenes for MainMenu, MapSelection, and GameMap, and I'd want to include MasterAudio-related manager objects as a DontDestroyOnLoad. How do I manage testing of those individual scenes while having an instance of MasterAudio attached? Can I automatically (via code) assign the MasterAudio manager? Rewired has a RewiredPluginManager prefab that can be attached AFAIK, and I'm wondering if Master Audio has something similar, or if I have to always attach a MasterAudio object to each scene, or one scene that I should always load such that DontDestroyOnLoad carries over to the other scenes? Basically, I'd want one MasterAudio object in a build, such that all scenes use the same MA instance, but during testing, I'd want MA to load for each scene I open.
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You can put a persistent (DontDestroyOnLoad) game object in the first Scene. There's a checkbox for that option in the Inspector. As far as being able to start other scenes and still use that one - you go ahead and add the same MA game object prefab in each Scene. Master Audio will automatically detect a "duplicate" MA game object when you load the other scenes and destroy the new one upon loading. No "hooking up" is needed.
     
  32. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    Okay, that makes sense. So, I would essentially want to do something like this. Please let me know if this is incorrect. I can copy the MasterAudio.prefab out of the DarkTonic directories, and put it in my own custom game folder, modify the settings/properties/etc as I need to, and add that to each scene. Or what if I added a custom script that auto instantiates the MA object on load? I would prefer this, so that the prefab isn't tied directly to one scene.

    Ugh, so many questions sorry. Like, supposing I had a MA object for each scene. Where do these exist in the asset tree? Are they copied from the original one in the DarkTonic folder and moved somewhere else?

    Thanks for being patient with my questions.
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Pretty much. You don't "copy" the Master Audio prefab, you make your own prefab from it from the Master Audio Manager window, so it's not linked to the original. That way you won't overwrite yours when you upgrade the plugin. Store the prefab wherever you like, but definitely not in our folders because it might get destroyed if you upgrade after deleting everything (not necessary usually).

    You can try the Instantiation thing, but it will really slow down your workflow if it's not in your Scene. You'll have to put it into a Scene when you want to work with it (add SFX, change levels, etc). Also, anything that tries to make a sound before the MA game object is there will log errors to the Console. I'm not sure why you'd prefer to do it that way.
     
  34. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    All good points. Thanks. As far as the auto instantiation thing, it's just my own concerns that are probably unfounded altogether. I'm a fan of decoupling, and I'd prefer to have my Unity scenes not contain any third-party components, unless I explicitly include them via script, which can be eventually abstracted out to an interface that would allow me to not be tied to an individual asset, so swapping in a similar system would hopefully require less work. That said, I've seen your passionate support on these forums it probably isn't really a concern for Master Audio. Thanks for your rapid responses!
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sure. You can do it that way if you like, but like I said it will slow you down. Also, you wouldn't be able to use the "Save Runtime Changes" option because the game object will disappear when you hit stop. So that code won't be able to locate the prefab and re-apply the changes...
     
  36. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Hello. I have two groups with several hundreds of variations and I would prefer to keep them separate. Is there a wat to call PlaySound() that instead of a group name would take a list of group names to look for the sound variation?
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No. Sound Groups are self-contained and don't know anything about other Sound Groups. You could write code to do that but you should always know where your Variations are. If you don't know by the Sound Group name, then in my opinion you haven't thought enough about what should go where.
     
  38. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Something like checking PlaySoundResult.SoundPlayed and calling PlaySound with another group name? Would that be too much overhead?
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I don't get how that has anything to do with what you asked...

    You asked that you want to be able to play Variation X but you don't know whether it's in Sound Group X or Y (not sure why you don't know though).
     
  40. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Say I want to play the sound "boom". It's either in group1 or group2, but I don't know which one. So I do something like this:
    Code (CSharp):
    1. if(null == MasterAudio.PlaySound("group1", "boom")) MasterAudio.PlaySound("group2", "boom");
    Or is it better to check AudioSourcesBySoundType.ContainsKey(sType)? Sorry, I don't know all the internal workings of MasterAudio, so perhaps this is not the best approach. And yes, in most cases one group should be enough, but I have a reason to have the sounds in two separate groups.
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There's no sure way to try and play it and know if it was in that Sound Group like that. It could have not played because all the voices were busy, bus voice limit was reached, not existing (yes sure) and a couple other reasons I forget as well.

    I really don't understand how you wouldn't know what Sound Group a Variation is in. It sounds like you should probably have a lot more than 2 and you haven't organized them well enough if you don't know what group it's in. Sound Groups are supposed to be used like:

    1) Death sound with one or more variations
    2) Shoot sound with one or more variations
    3) Jump sound with one or more variations.

    Not just dump seemingly random variations into them. If you do, then what's the point of having Sound Groups like that if it may play all sort of different unrelated sounds? They should be a logical grouping and nothing more. You want to hear one of the random Death sounds? Then play the Death group.
     
  42. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Thank you for clarifying that :) Is there any reason why AudioSourcesBySoundType.ContainsKey(sType) or something similar won't work?
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That would just tell you if a certain Sound Group exists. This would be the code, that must run inside MasterAudio.cs since the AudioSourcesBySoundType is private.

    Code (csharp):
    1.  
    2.         public static bool IsVariationInSoundGroup(string sType, string variationName) {
    3.             if (!Instance.AudioSourcesBySoundType.ContainsKey(sType)) {
    4.                 Debug.LogWarning("Could not locate group '" + sType + "'.");
    5.                 return false;
    6.             }
    7.             var grp = Instance.AudioSourcesBySoundType[sType];
    8.             for (var i = 0; i < grp.Sources.Count; i++) {
    9.                 var aVar = grp.Sources[i];
    10.                 if (aVar.Variation.name == variationName) {
    11.                     return true;
    12.                 }
    13.             }
    14.             return false;
    15.         }
    16.  
    If you add it into MasterAudio.cs of course the method will disappear next time you upgrade if I haven't added it there. I still don't understand why it's needed or I would add it. Seems like an invalid use of Sound Groups unless you can explain why it's needed.
     
  44. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Wow! Thank you so much! As far as having multiple groups for similar sounds, that's more of a legacy issue. It could have been done either way, but at this point having two separate groups makes more sense. Just to be clear, I'm not in any way implying that this is one of the things that should be handled by MasterAudio "out-of-the-box". It already has what most users need and more :)
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Well you having to add code each time you upgrade is not ideal, but I don't think it should be in the core as it seems more of a band-aid than an actual need, so I guess we're leaving it like this.
     
  46. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    I've got AmbientSound scripts added to prefabs that sit on top of terrain created via MapMagic, so as new terrain generates in real time, these prefabs are created and placed on the terrain. I'm having an issue where the only way I can hear the ambient sound is to turn off the AmbientSound script on the prefab, then turn it back on again. I guess something odd is happening with OnEnable or StartTrackers()?

    I don't see any _Followers transforms until I turn the script on/off as above or turn the gameobject on/off. Also once I've turned it on/off, if I repeat the process again, the sound seems to play for a split second before turning itself back off, or it seems random whether I get the sound happening again.

    Any idea what might be happening?
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No idea. I've used AmbientSound script on things that spawn I believe and it worked fine. You'll need to send me a stripped down project that shows this weird behavior if you want me to investigate.
     
  48. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    After some more searching it appears I'm having this multi-scenes problem: http://darktonic.freeforums.net/thread/863/ambient-sounds-spread-multiple-scenes So I guess I'll have to code something up to disable/re-enable all ambient sounds.
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yeah that was pretty hairy. I'm going to look at the previous guy's project again and see if there's some trick way to get that working. Will report back hopefully tomorrow.
     
    Exbleative likes this.
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    So I looked at my example again.

    It happens when you load a Scene with AmbientSounds and then *later* load additively a Scene with the Master Audio game object. That just will not work and it seems incorrect to do it that way. You should always load the MasterAudio game object (whatever Scene it's in) first if you expect things to work properly.

    Is there a reason you can't do that? It should be easier than coding up what you suggest.