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
    You are right about the second part. It doesn't matter how far you are from the caller, it can still be heard. However Set to Caller is working. I suspect that the AudioListener in Unity is broken in this version. This is not a Master Audio problem. I'll report a bug. Although I'm not sure how in Unity 5 you specify that you want to play a sound as 2d/3d? Anyone know?
     
    Last edited: Nov 18, 2014
  2. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Any way to have a playlist start with the same song every time MasterAudio is first loaded, and then go into shuffle mode after that? Thanks!
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You can try playing that specific song by name (turn off Start Playlist on Awake) with shuffle mode on. Let me know if that works for you.
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Here's the answer from my bug report, from Unity. It's not a bug at all.

    Thanks a lot for reporting the issue. However, it's not a bug. By default from Unity 5.0 all sounds are 2D sounds. To turn them into 3D sounds you need to move the "Spatial Blend" slider on the AudioSource all the way to the right.
     
  5. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    ok I'm a little confused here. If I have no Unity Audio source on my object it will still play the master audio tracks I put there. Am I supposed to add a Unity audio source?

    I tried with the Unity audio source attached and did what you said (Spatial Blend) but it didn't work.

    Even though I've added the clips to Master audio system am I supposed to add them to the Unity audio source clip section too?
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No. There should NEVER be any Audio Sources on any of your game objects when working with Master Audio, because that leads to many problems and they can't be controlled by the plugin. All the Audio Sources are contained under the Master Audio prefab itself (and Playlist Controller). So go into the Sound Group in question and modify its Spatial Blend (for each Variation apparently). It sounds like they moved 2d/3d sound settings off the Audio Clip and onto the Audio Source.

    You'll probably want to just go modify the template instead and recreate your Groups so you don't have to do each one. These are both a workaround. I'll make a modified template for Unity 5 in the next release, hopefully later this week.
     
  7. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    ok thanks it works now.

    One last question. is Logarithmic rolloff supposed to keep playing slightly when you are far from source?

    when I changed it to linear it worked as expected, but Logarithmic continues to play very faintly from far. is it supposed to turn off completely at some point?

    Thanks
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I believe so, yes. If you think it's not working properly, please report a bug to Unity. This is not a Master Audio problem.
     
  9. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    Unfortunately I've not been able to isolate it, and the project is very large. I'm going to ignore the problem for now, since there's an easy workaround of simply setting the mute in my program code. If I should find the cause I'll post again here about it.
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, thanks for the update.
     
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Does anyone know a good resource for new events we should code for, that will be added in the UI for Unity 4.6? Or is there an example UI project I can download?
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Heads up to you guys: Loading Resources asynchronously is apparently getting yanked from the Unity 5 API and will not compile. So you will have the ability to load async with Unity 4.5 - 4.6 and then lose it. Don't worry about the compiling part because it's already that way in the latest MA and it compiles fine on Unity 5.

    Crappy move by Unity. They said it wasn't supposed to be a public method and was poorly planned. And that we're supposed to use Asset Bundles instead of Resource files in the future. I have no idea how that makes any sense because I thought Asset Bundles are for external files and Resources are internal. Perhaps that's changing. I'll let you know when I know more.
     
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Master Audio 3.5.6.5 will be live in 20 minutes. Changelog:

    • Fixed bug of stack overflow caused by SoundFinishedEvent that calls stop on the same Variation that's playing, directly or indirectly.
    • Fixed bug: The 2 Audio Sources on Playlist Controller didn't have the same custom rolloff. Note that this will only fix Playlist Controllers you haven't created yet. To fix already created ones, delete them and recreate from Master Audio Manager window.
    • Fixed bug: calling MasterAudio.SetBusVolumeByName sometimes had out of index error.
    • Fixed bug: Dynamic Sound Group Creator would log an error if you call RemoveItems more than once.
    • Fixed bug: One clone of the first Variation in the first Group didn't had its pitch reverted to 1.
    • Added button for "wide mode" between the mixer and buses. Makes the faders 3 times as wide for fine tuning levels.
    • Attention: Users of the DF-GUI Master Audio package will need to install the new version of the package to compile again.
    • Added MasterAudio.UnsubscribeFromAllVariations method to unsubscribe from all SoundFinished events in every single Variations in the entire MA Hierarchy.
    • Added Custom Event import/export ability to the Organizer.
    • Added new option to Dynamic SGC to choose whether the items get created on 2nd+ Enables or not (defaults to not). Turning this on means you can repeatedly disable and enable DSGC's to add and remove audio items from Master Audio.
    • Added new method: MasterAudio.MasterAudio.GetAllPlayingVariations(). Returns a list of all SoundGroupVariations that are still playing.
    • Now the yellow voice count numbers next to each mixer row and bus are buttons that can be clicked on to select all X of the Variations that make up that voice count.
    • Chained Loop Groups can now cross-fade! Just set up each Variation with Custom Fading. Any Variation with Custom Fade Out time will trigger the next clip in the chain when the fade out starts instead of when the clip ends.
     
  14. Teku-Studios

    Teku-Studios

    Joined:
    Sep 29, 2012
    Posts:
    257
    Nice update, @jerotas! Is it mandatory to update to Unity v4.5.5 in order to get it? We are really interested on those bugfixes and new features but we can't upgrade Unity since we are working for WiiU and Unity is stuck at v4.3.4 for it.
     
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No, it's not. Not sure how that happened. Resubmitting now with Unity 3.5.7. It will be live in 20 minutes.
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Does anyone have any details about the Spatial Blend control in Unity 5? I'm wondering why it's not just a 2d/set checkbox. It allows a range of 0-1. How is that useful?
     
  17. Teku-Studios

    Teku-Studios

    Joined:
    Sep 29, 2012
    Posts:
    257
    Thanks for such a quick fix :)
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No problem :)
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I would appreciate it if a bunch of Master Audio users would go post to the thread here and say "We need Resources.LoadAsync to stay in Unity 5" in your own words. They have announced that they're removing it from the API.

    http://forum.unity3d.com/threads/list-with-obsolete-api.276379

    You will lose something cool if we don't get enough voices hears on this. Thanks in advance!
     
  20. Teku-Studios

    Teku-Studios

    Joined:
    Sep 29, 2012
    Posts:
    257
    Count us in ;)
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thanks Teku!
     
  22. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Arghh...

    Thought I had learned how to loop a simple clip but apparently something's up.

    First I just got the latest and shiniest version of MA.

    Somehow when I play my scene the Volume in the Sound Group Variation sets itself to ZERO and even though Loop Clip is checked no sound is heard.

    0.png 1.png 2.png 3.png
     
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yes, the first sound of the first Group is played silently and then instantly stopped, for code warming purposes. That has the side effect of turning the volume of the Variation to zero. However, when you play the sound the next time, it will return to its normal volume.

    How are you playing the sound? Preview, code or what? I could not reproduce your problem.
     
    Last edited: Nov 21, 2014
  24. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Since this is the background sfx for this scene I was expecting it to play. I have no idea what I did differently to the other scene that works.



     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You are expecting it to play from what? Do you have code telling it to play? Are you using Event Sounds to make it play? You didn't answer my answer so I can't help so far...
     
  26. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    :mad::mad::mad::mad::mad::mad::mad:
    Seriously I can't believe I wasted your time with such lame questions!



     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'm not clear. Are you saying you don't have any code / script telling the sound to play? If so, I guess we're good :)
     
  28. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    I didn't have any Event Sounds script anywhere in this scene. :rolleyes:

    Thanks

     
  29. lbaugusto

    lbaugusto

    Joined:
    Nov 24, 2014
    Posts:
    2
    I apologize if this has been answered already (going through 41 pages of messages is pretty tedious), but is there a way to get Master Audio to work with Unity's UI objects (sliders, buttons, toggles, etc). So far, I haven't found a sound trigger that works with any of these. For example, I would like to use a slider to adjust the volume of a currently playing sound or audio group, or clicking a button to trigger an audio group. I've tried using the ui events as opposed to the event sounds script, but I haven't found the appropriate way to do it.

    Also, is there a way to play all variations of an audio group or all songs in a playlist at once? I would like to create an audio group or playlist for each song and have variations or playlist items be different instruments in the song that are synced and played together.

    I'm using Unity 4.6.0f2

    Thanks!
     
    Last edited: Nov 24, 2014
  30. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Going through 41 pages of a thread is definitely not a good way :(. It would be best if everyone would use our support forum here: http://darktonic.freeforums.net/. Unfortunately most people still post to this forum or email us, so we'll need to repeat many answers. I don't mind answering emails or this thread though, just saying :)

    The Unity 4.6 events is on the roadmap and is not done yet. Here's the roadmap thread: http://darktonic.freeforums.net/thread/87/feature-roadmap-master-audio-suggest

    If you could point me to what those 4.6 UI events look like in code, I can get that done soon.

    A way to play all Variations of a Group is also on the roadmap.

    Play all songs in a Playlist at once? No, that's not planned at all. I don't think it's needed. Playlist controllers can only play one song at a time. But you can have as many controller as you like and have them each play different songs. Have you watched our Synkro video on youtube?
     
    Last edited: Nov 24, 2014
  31. maxxa05

    maxxa05

    Joined:
    Nov 17, 2012
    Posts:
    186
    There was some API changes in Unity 5 beta 14, and since then Master Audio does not compile. For example, AudioClipFormat does not exist anymore. I'll find a way to get around this for the time being, but I thought you might want to know this.
     
  32. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'll fix it tonight, thank you for letting me know. I suspect that error is in the MasterAudioManager class right? Which isn't very useful now that you can bulk edit Audio Clips in Unity 5. If I'm correct, go ahead and delete that class to unblock yourself until I make the update.
     
  33. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    Hi,

    Does anyone know how I can stop my playlist from losing audio between scene loads?
    It starts playing in the first scene, as soon as the second scene loads up the master audio inspector still shows the data and the playlist information during play mode shows that it's playing - yet I cannot hear anything. The only way I've been able to get it to actually produce any sound after this is to stop all playlists then start playlist - but I really just want the audio to continue.

    Thanks.
     
  34. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That scenario works fine for me. In fact there's 2 Example Scenes that do exactly that in the plugin. You will need to send me an example scene that reproduces the bug you're seeing.
     
  35. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    hmmm, perhaps it's because I'm using the 4.6.0f3 - If this scenario is meant to work "out of the box" then it's very possible either I've done something wrong (it's my first time using Master Audio) or 4.6.0f3 has a snag, either way, thanks for the quick response. I'll launch a clean project and experiment there. If it's not me (ie if I do find something odd) I'll report back.

    Thanks again
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok keep me posted DarkArts. Interesting to see you using our plugin. You make a cool audio one as well :)
     
  37. lbaugusto

    lbaugusto

    Joined:
    Nov 24, 2014
    Posts:
    2
    Thanks for the info! I actually didn't know about Synkro but I will have to check that out, that sounds exactly like what I was looking for.
     
  38. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Cool, we are always here for any questions or feature suggestions.
     
  39. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    How do I start playing a specific song by name...is it the TriggerPlaylistClip() method?

    And will it continue playing the rest of the playlist once the song is finished?

    Thank you
     
  40. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You are correct, that's the right method. If the song isn't set to loop and you have auto-advance turned on, then it will continue to the next (or random) song at the end of that song.
     
    eridani likes this.
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I tried to fix it, but it looks like Unity has closed off certain parts of the API. I get this error after fixing a few others:

    `UnityEditor.AudioImporter.format' is inaccessible due to its protection level

    So what I am going to do is remove the Master Audio Clip Manager so it's not visible from Unity 5 at all. It will still be available on previous versions. This may sound like a shock to some, but it's actually no big deal. In fact, my post about why Master Audio is still relevant and needed after Unity 5 mentions up front that our ducking and Clip Manager probably won't be used by Unity 5 users. Unity 5 already has the ability to bulk change import settings of Audio Clips (the lack of this feature in Unity 4 is why we built the Clip Manager).
     
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'm about to release the hotfix version. Anyone who doesn't want to upgrade right now but uses Beta 14+ of Unity 5 can just delete MasterAudioClipManager.cs
     
  43. jerotas

    jerotas

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

    • Added Retrigger Limit controls to Footstep Sounds script. Applies to all tag / layer triggers at once.
    • Added an optional "fire 'Items Created' Custom Event" section in Dynamic Sound Group Creators, so you can be notified that the sounds are created and ready.
    • Removed Master Audio Clip Manager from Master Audio for Unity 5+. Certain parts of the Audio Importer API has been closed off by Unity so this code won't work anymore. It's fine though because Unity 5 has the ability to bulk change Audio Clip import settings (which is exactly what Clip Manager did).
     
  44. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    Ok so, after a very frustrating session involving switching between 4 different Unity versions across two different machines/operating-systems (Windows/Mac) and creating several stand-alone scenes I finally figured out how to "fix" this in my particular case, and yet still being unable to reproduce this within a clean project. What's important to note here is that within my project even clean/new scenes do this, however this was a clean/new setup imported (via .unitypackage) from an export clean project which does NOT have this symptom.

    The problem:
    The clip in my playlist, although master audio reports it's playing even giving positional information, has no sound at all.

    The "fix":
    It turns out that although music (playlist) this clip was, as I received it from yet-another unity asset store purchase (music pack) set to "3D Sound". As soon as I disable this and apply (on the clip) everything works as expected. Again, it's important, I feel, to emphasize that this exact same clip with the exact same settings (3D Sound) works as expected with Master Audio in a clean project with an identical setup on the same Unity version.

    My suspicions of what's going wrong:
    • I think this is a Unity bug, not Master Audio
    • I think it involves audio memory usage
    ... this is complete guess work on my part though ;)

    Additional information:
    Using Assets/DarkTonic/MasterAudio/ExampleScenes/Audio/Music/bass.wav as a baseline for test sanity (haha - baseline - :]) I was able, within my own project, to reproduce this by using that clip itself and merely altering it's import settings to "3D Sound" (checked/enabled) at which point it does not, within my project, play across scene loads (even though Master Audio reports it is doing so).
    My project is an almost complete game and incredibly large at this point, I'm unfortunately not able to share it or it's scenes and I'm not getting this symptom outside of this project.
    What I'm using: Unity 4.6.0f3 + Master Audio v3.5.6.5.1 with build platform Android

    Since I'm able to work around this (by setting "3D Sound" off for music -- which it should be anyway) ... I'm not going to spend any more time looking into this. I hope this "data dump" is useful however should something like this ever be reported again.
     
    Last edited: Nov 26, 2014
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Whew! What a read. Thank you for doing the legwork, I appreciate your frustration. After reading all that, I actually don't think it's a Master Audio bug or a Unity bug. I think in your new 2nd loaded Scene, the Audio Listener is simply a lot further away from the location of the Playlist Controller, and therefore can't be heard based on the 3d settings of max distance on the Audio Source in the Playlist Controller. Setting the audio to 2d though, would solve this problem in every case and is in fact my recommendation for all music (it's mentioned in the best practices section near the end of the readme). I know it's an easy thing to miss. I have done it before.

    What's good is that in Unity 5, all sound will default to 2d, and setting of 2d or 3d will be on the Audio Source, not the Audio Clip. So we'll make a setting on the Playlist controller itself to control that.

    -Brian
     
  46. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    Oh ... wow, serious face-palm moment. And this kids is why you shouldn't work till 5am

    Sorry for wasting your time. Amazing product you've created - really can't believe I've been hand-solving everything Master Audio does, in every game, every time. This is an insane time saver!
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It's not a waste of time if you've learned something :)

    Thank you for the compliment. It would awesome if you posted a comment like that as a review on the Asset Store. This plugin has been a long, long time in the making. We are lucky enough to have used a thoughtful enough design at the beginning that could be expanded on without getting too unintuitive. And we're also lucky to have had a few extremely demanding customers that threw us a lot of great ideas to expand the product.

    Do let us know if you can think of anything you'd like added, or would like to see a video of (many videos are coming soon by the way). Sorry about the long amount of time since the last videos were made. I was having technical problems. They are solved!

    -Brian
     
  48. andrew-rc

    andrew-rc

    Joined:
    Jun 20, 2013
    Posts:
    10
    Hi - can you please clarify how pooling works in Master Audio?
    It looks like MA creates a bunch of AudioSources at runtime for each possible instance of a sound (each sound group's Weight), but this could create many, many sources in the scene (it's not unreasonable for a game to have 150 sound effects, with 5 or so variants each. That's 750 AudioSources sitting in the scene, which will be idle most of the time).

    Normally when I think of pooling, I'd expect something like the scene to have 10 or so AudioSources that get reused with different clips and positions each time we want to play a sound.

    If MA works how it looks like it does, is there any impact of having that many idle AudioSources in the scene at once? (I've just done a quick test and it looks like 700 idle AudioSources adds about 10MB to a build's memory footprint - not too bad). Does this cause any other problems for anyone? Or is this usually OK, and Unity handles large scene hierarchies?

    Cheers!
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Howdy Andrew!

    I see what you're saying. The main reason for wanting / using Pooling is to avoid the performance costs associated with Instantiate and Destroy and the Garbage Collection that occurs from them. Master Audio indeed never Instantiates or Destroys anything except during Scene startup. But yes, you are correct. Things are not reused for different purposes (except as the individual Variations are slightly tweakable at runtime). Someone once asked if we could make all the Variations that weren't playing disabled Game Objects. But I did a prototype, and it didn't seem to have any effect on audio memory (more below on this). Anyway, this wouldn't really be feasible to do with Audio Sources moving around between Variations. It would probably hurt the performance a fair bit because it would become Instantiation of components.

    A high number of Audio Sources doesn't seem to matter much. What matters a lot more is how many of them are playing. If there are more than 32 playing, then the prioritization feature of Unity will take over and cull the rest. The "extra" Audio Sources with the same Audio Clips assigned don't take up any extra audio memory (or very little if your tests are more extensive perhaps) or performance when they're not playing. They are paused and do nothing. Also, all the scripts we have on those Variations do not run any code except when audio is playing, so it scales nicely with hundreds of sounds. We have about 150 sounds in our 2nd game, which is almost released.

    You will find that with a lot of audio, the most important thing to do is to use Resource files for (probably) all music and a lot of infrequently played SFX. The audio you set up as Resource files in Master Audio will take up zero memory except while they are playing.

    I'll do some more testing about "extra" Audio Sources in Unity 4 and 5 and see what's more correct.
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I did some more profiling. On Unity 3 and 4, it costs about 0.8 Kb of audio memory for each additional "clone" that gets created for weights > 1 of Variations. So adding about 700 clones for polyphony reasons adds only about 0.6Mb. Insignificant really.

    However it gets even better. You'll be extremely excited to hear (as I am) that the extra clones take exactly zero additional audio memory on Unity 5!

    Bring it on Unity!