Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. 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

[20% off!] 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. MudPuppet

    MudPuppet

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

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

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


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

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    Unfortunately there's not a way to check which clip(s) are being played by the game object right now, although I just added it to the roadmap for the next version.

    You will need to infer what clip is playing by keeping track of the state of your audio in that script instead. I would suggest using an enum with all the values like: Idle, Driving, etc and checking the value of the enum. Then when it needs to play another sound, you will do code like:

    MasterAudio.PlaySound3DFollowTransform("YourSoundGroupName", this.transform);

    Yes, you should be able to use the same script for all of the same vehicle. Since Sound Group names are strings, you should put variables in the script with the SoundGroup Attribute and use those when you call the PlaySound3D methods, like this:

    [SoundGroup] public string EngineSoundGroup = "";

    MasterAudio.PlaySound3DFollowTransform(EngineSoundGroup, this.transform);

    That way the Sound Group can be assigned from a dropdown in the Inspector.
     
  3. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    155
    Hey Brian, once again thanks for that information. I will look into your suggestion and try to rework my script using standard AudioSource/Clip components first and then tackle the MA conversion from there.
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    Ok. MA conversion will entail having no Audio Sources / Clips on any of your prefabs and all that, as you are probably aware.
     
  5. darkyer

    darkyer

    Joined:
    Sep 11, 2013
    Posts:
    13
    Is there a way to create a dynamicGroupCreator fill it with some sounds in gameplay, I'm working on a game 1vs1 online and I need to change the sounds depending of each character, so I was able to create the dynamicGroupCreator via script but I'm not able to fill it with audioclips
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    That script has tons of fields and is not meant to be used via script, so not supported but you're welcome to try.

    What are you trying to solve and I'll see if I can suggest a different way.
     
  7. darkyer

    darkyer

    Joined:
    Sep 11, 2013
    Posts:
    13
    thanks, the main idea of the game is a 1vs1, each player has some AI companions that have different weapons, spells, etc. I just have 1 scene where I load map, players and AI's so I wanted to instantiate the master audio with only the weapon/spells sounds of the players in the map, not all of them.
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    So you will need to create a DGSC for each single player's (in the map) Sound Groups. That can live on the player prefabs. Then when the play game object becomes enabled, the Sound Groups will be in MA game object.

    Don't try to create one giant DGSC.
     
  9. darkyer

    darkyer

    Joined:
    Sep 11, 2013
    Posts:
    13
    Nice, I think I can make it work this way, Thanks for the support
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    Excellent. No problem.
     
  11. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    @jerotas Hey so I noticed the AddToQueuedOcclusionRays function caused some garbage because of ElementAt(i)
    So I made a change which seems to eliminate the garbage. Apparently foreach loops on queues don't cause garbage?

    Code (CSharp):
    1. foreach (var occlusionRay in QueuedOcclusionRays) {
    2.     if (occlusionRay == updater)
    3.         return; // already in there. Should almost never happen except under weird circumstances.
    4. }
    Cheers
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    I always avoid foreach loops because they execute slower, and most people using Unity make mobile games, so that's quite important. I also go for the faster code. However, garbage collection is even more important. Didn't know that causes GC.

    Thank you for finding it and for the fix! Included for next update.
     
  13. Argiris

    Argiris

    Joined:
    Nov 14, 2014
    Posts:
    23
    @jerotas

    Hi Brian.

    I wasn't able to find a tutorial/forum thread for how to seamlessly (without any gaps whatsoever) loop 1 audio file as background music in game, for example.

    Any help you could provide would be greatly appreciated!
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    I think you're saying you just want 1 song to loop?

    You could watch the Synkro video, and just do a single layer. Basically:

    1) Create a Playlist Controller
    2) Create a Playlist.
    3) Add a single song to the Playlist.
    4) Mark that song's "loop" checkbox.
    5) Assign "Initial Playlist" of Playlist Controller to your Playlist.

    That should do it. If it's not looping seamlessly then it's a problem in your audio file. i.e. Unity won't be able to loop it seamlessly regardless of whether you're using Master Audio or plain ol' Unity. There's no special setting for a single song to be able to loop seamlessly. It either does or doesn't. We have the "gapless song transition" stuff as an option but that doesn't come into play on a single song.

    If your song won't loop properly, you would need to edit it in an audio editing program or DAW and export it properly for seamless looping before it will work.
     
    Last edited: Jun 4, 2017
  15. Gooberverse

    Gooberverse

    Joined:
    May 17, 2015
    Posts:
    3
    I own Behavior Designer and Master Audio. I could not find any docs that explained how to use the Behavior Designer integration, so I just double clicked on the unitypackage and imported it. I've done it twice and this is the result.

    Any ideas on how to resolve this error:

    Assets/Plugins/Behavior Designer/Third Party/Master Audio/Tasks/AddDuckingGroup.cs(20,10): error CS0246: The type or namespace name `SharedFloat' could not be found. Are you missing an assembly reference?​

    I'm getting this error for all references to Behavior Designer types that extend SharedVariable. (SharedString, SharedBool, SharedFloat, etc.).

    Thanks for any assistance! Master Audio has already saved me lots of time, but getting this integration working would make things even better.

    I've got v1.5.9 of Behavior Designer imported (and running fine) and the latest MA installed.
     
    Last edited: Jun 5, 2017
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    As with all the integrations, the plugin you're integrating with must be installed in the Assets/Plugins folder since that's where Master Audio is installed. I'm guessing that probably Opsive is still installing things in the Assets folder (not Plugins) which is a no-no and slows down your compile time every time you change a script file that's not in the Plugins folder. If that is true, you will need to move Behavior Designer into the Plugins folder before things will be able to compile. If you installed other Behavior Designer integrations, all those plugins will need to be moved into Plugins as well.

    Basically just look for the SharedFloat class in Project View and see if it's under Assets/Plugins or not. Let me know whether that is the case or not. If that is the problem, please ask the author if he has considered moving all code into Plugins since it helps compile time. Perhaps he is unwilling to do it because he integrates with lots of other plugins, most of which are also not in the Plugins folder, so it would cause him more grief and answering like I'm doing right here. It's kind of a chicken and egg problem, but we chose to do it right even if there are occasional problems. I wish more would do the same. We're still more the exception than the rule on this subject.

    -Brian
     
  17. Argiris

    Argiris

    Joined:
    Nov 14, 2014
    Posts:
    23
    Thanks a lot, Brian.

    I love gapless looping! :)
     
    jerotas likes this.
  18. Gooberverse

    Gooberverse

    Joined:
    May 17, 2015
    Posts:
    3
    Brian, that was my problem exactly. Moving the Behavior Designer code from Assets to Plugins took care of everything and now I'm not having to wait for all that code to compile. I totally get the chicken and egg thing.

    Thanks for your awesome support. Master Audio and your level of support are the best there is. Thank you!
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    Great to hear that you're up and running again. Justin is aware of the Plugins thing, I wonder why he hasn't made the switch yet?
     
  20. Argiris

    Argiris

    Joined:
    Nov 14, 2014
    Posts:
    23
    @jerotas

    Hi again, Brian.

    Suppose I want to have clipA play once, followed by clipB to loop seamlessly and indefinitely, both with clipA and itself, like so: clipA, clipB, clipB... etc.

    Is it possible to add both clips to a playlist, detect when clipA has finished playing, remove it from the list and thus have clipB loop forever after that?

    Thanks!
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    Yes, you can do that. Just make sure to check the loop checkbox for Clip B. The way to get the seamless transition from clip a to b is to turn on Gapless Music Switching in Advanced Settings.

    No, clip A does not get removed from the Playlist. It doesn't need to. If you have more songs after clip B, you would have to tell the Playlist controller to play the next song or it will loop forever on clip B.

    This requires no coding.
     
  22. Argiris

    Argiris

    Joined:
    Nov 14, 2014
    Posts:
    23
    Excellent! I'll check it out.

    Thanks a lot! :)
     
    jerotas likes this.
  23. Argiris

    Argiris

    Joined:
    Nov 14, 2014
    Posts:
    23
    @jerotas

    Brian, I used the setup you suggested, and although clipB (main_theme_loop) loops fine, clipA (main_theme_intro) seems to crossfade with clipB, (as you can see in the screenshot) which destroys the gapless playing.

    Any ideas?
     

    Attached Files:

  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    Turn off crossfading. It's incompatible. Set master crossfade time to 0.
     
  25. Argiris

    Argiris

    Joined:
    Nov 14, 2014
    Posts:
    23
    Thank you, Brian! I hadn't noticed that option was on by default.

    Now there's something else going on, which I find very strange. The first time I press Play to run the game in Unity, clipA skips a few ms before clipB begins, but if I stop the playlist and play it again from the side controls (no matter how many times) the seam is fine (listen to attached). I also tested this on 2 devices.

    Both clips are configured with a Vorbis compression at the moment, set to Decompress on Load.

    How can we fix this issue?
     

    Attached Files:

  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    That zip isn't downloading for me. Questions:

    1) What file format are you using for your songs?
    2) Show me the entire audio import settings for your song clips.

    I did quite a bit of fixing the gapless code to work without space or overlapping and I doubt that it can be done any better. However a different file format or setting may fix it. On the several mp3's and wavs I tried it was perfect.

    You also should try with Resource files if you're not, and try with "Preload Audio Data" turned off as well. Let me know what ends up working for you, and what does not so I can document it.
     
  27. Argiris

    Argiris

    Joined:
    Nov 14, 2014
    Posts:
    23
    Hi Brian.

    Thank you for your reply. Please listen to that audio file here.

    Regarding your questions:

    1. Both audio files are WAV, 44.1 Khz, set to be compressed as Vorbis in Unity.
    2. Please see the attached image.

    I changed the Clip to ResourceFile too, but that didn't seem to make any difference.
    I also played around with the different Load Types, but there was no audible change.
     

    Attached Files:

  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    Ok, have you tried without streaming? Have you tried a wav or ogg file (not compressed)?

    You changed the clip to Resource File - did you *use* the Resource file as a Resource file by changing the Audio Origin field of each song and dragging the file in there? You do not reference it as an Audio Clip or it won't behave any differently.

    Also, are you saying it works fine in the Unity editor and only has a problem when you export it? Which platform are you exporting to?
     
    Last edited: Jun 7, 2017
  29. Argiris

    Argiris

    Joined:
    Nov 14, 2014
    Posts:
    23
    1. I had tried a non-streaming option too. Didn't work as expected.
    2. It didn't work properly in the Unity editor either. Same behavior on both the Editor/device.
    3. The audio files are inside Resources/Music. I changed the Clip Create Mode from Clip to Resource File for the Playlist, but nothing changed. I then changed the Audio Origin to Resource File, as well. No music playing at all, so I thought that wasn't the solution.

    I never noticed the green prompt, to drag the audio files in there, when I wrote my previous post. I just did and it works fine! :D

    I'm now going to build on the device.

    Thanks a lot, Brian!

    PS: Can you guess why it works with this method?
     
  30. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    If you didn't drag in the file or enter the Resource path, it would not know what resource you want. It wouldn't play anything. Resources are only loadable via a path (folder + file name).

    Anyway, glad you got it working. I always use Resource files myself. It seems like perhaps the events / timing somehow work better with them. My recommendation is always to use Resource files, and here's one more reason why.
     
    Argiris likes this.
  31. bigbrainz

    bigbrainz

    Joined:
    Jul 21, 2015
    Posts:
    114
    I'm working on getting our ambient music files to download as internet files to keep our WebGL bundles small. Putting them in a resource folder would only make the main download even bigger. I would rather load them from bundles, but I read that's not possible or planned to be possible. But then I read where you said that Internet Files are only intended for Sound Effects. Our music files are much bigger than our sound effect files. Can you walk me through how you recommend that we implement these larger music files? I have the DynamicSoundGroup set up and working fairly well btw so the MasterAudio object is persisting across scenes nicely.

    Looks like this guy was getting close, but then the discussion went offline. I'd love any insight you picked up from that questions: https://forum.unity3d.com/threads/3...in-on-asset-store.168074/page-51#post-2141838

    Many thanks!
     
  32. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    That guy was talking about streaming assets, from local folder. Not going to help your file size either.

    Actually, Playlists don't even offer the option for "file from internet". It's not even there.

    We are not against implementing bundle code, but I've asked many times and no one has been able to just tell me how exactly it would work (what the UI would need to gather from the user to make it work) and so it was pulled off the roadmap (would you be able to tell us that?). I've never used bundles myself so I don't know how they work. Resource files work beautifully for a lot of people but yes they do increase the build size unfortunately.

    I'm not sure that Playlists would work correctly with bundles / internet files unless we made sure that all the files were loaded before any started playing (which would be terrible on memory). I just want to avoid the problem where you turned on gapless song transitions but were unable to actually load the next song in time. Maybe that's not a very real problem though unless songs were super short?

    You could of course write your own code to download a bundle, load up some music files, populate a Playlist and so on, but those objects have a lot of properties in them...maybe you create your Dynamic SGC with a bunch of "no clip" songs and just populate the audio clips after the bundle is downloaded?

    I would like to get bundle support but I need help. Let me know what you want to do.

    Thank you,
    -Brian
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    We now have a sale on Multiplayer Master Audio. $60 instead of $99.99 gets you full multiplayer-ready Master Audio with either UNET or Photon!

    Upgrade price from Master Audio is now only $30 as well!
     
    Dwight_Everhart likes this.
  34. darkyer

    darkyer

    Joined:
    Sep 11, 2013
    Posts:
    13
    Hi there, I have another question, Is there a way to acces the audioclip? i need to know the lenght of it so I can play some animations according to the lenght of the audio

    thx
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    There is (I assume you're talking about a Sound Group Variation's audio clip?), however we have a new version of MechanimStateSounds in the upcoming update that lets you play a Sound Group after a certain percentage of the Sound Group Variation has been played, which you specify from 0 - 100%. And that requires you to write zero code.

    Is that what you're after?
     
  36. Wild-Factor

    Wild-Factor

    Joined:
    Oct 11, 2010
    Posts:
    605
    Hello, I want to replace my current audio manager, with yours.

    What I need:
    One of my character is using an axe to cut a tree. Another character of the team is also cut another tree as the same time.
    With the default setting it just skip when 2 group sound is played at the same time. I want the same sound play at least twice at the same time. I can have more than 30 characters doing the same work.

    If I add a Weight, it works, but it actually add me as much child audio source as the weight is set ! (20 -> 20 audiosource per sound !)
    And each child is added to the group during runtime. Shouldn't this be created dynamically? (my old manager do that).

    Another problem is at it's added to the group it interact with the Variation sequence. It is played like if it was inside the sequence !

    Reproduce this bug:
    variation mode to loop chain
    nb loop
    to 1
    Wheight to 20
    Just one variation

    It will play 40 times the same variation
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    That is correct, that's exactly how the Weight field works, if you read in the manual. The Weight is also the max number of that SFX that can play at the same time (which is why the field is also called Voices). Yes, it creates an additional Game Object with Audio Source for each Weight past 1. There is no problem having a bunch of Audio Sources with the same clip. You will not consume any additional Audio memory for the additional "clones" as of Unity 5.1. Also, we have no script running during Update / LateUpdate in Variation Game Objects that don't have a clip playing, so there's no performance change either. The script that does run during Update is in a script that is actually disabled until it is playing. Also, it's not "skipping" when the Weight is maxed out, but we don't spam the Console with messages unless you turn them on. You can turn on "Log Sounds" for the Sound Group or for all groups in Advanced Settings. If you did it would say something very helpful like "not playing Sound Group X because all voices are in using. Consider upping the Weight field if you need more voices". This any many many other conditions will be logged to tell you things aren't playing, but only if you turn them on. That's always the first thing I'd try when something doesn't work as expected.

    Your old manager did a definite bad practice - I'm guessing it was SoundManagerPro since that's the only product I'm aware of that does it that way. No Game Objects should be instantiated or deleted during runtime as it causes both Garbage Collection and inconsistent frame rate depending on what is in the scripts on the Game Object. We get around that totally by instantiating everything we need up front. Other plugins, such as our own Pool Boss, do it by also instantiating everything up front and keeping unused items "despawned" (actually disabled in the Hierarchy). This is common practice for pooling plugins.

    You just need to decide how many is the max you want to play at once and set the Weight to that number.

    I don't understand your other bug - you will need to give me clearer instructions. But yes if you have Weight = X inside a Looped Chain group, you will indeed hear the same clip X times in a row when you tell the Group to play, X times for each loop repetition that is. If you chose Endless then it will indeed play endlessly. If you only have 1 Variation, there's really no point in having the Weight > 1 with Chained Loop option on, since it will just repeat them anyway. And also, Chained Loop only allows 1 voice to play at a time max.

    -Brian
     
    Last edited: Jun 26, 2017
    Dwight_Everhart likes this.
  38. Wild-Factor

    Wild-Factor

    Joined:
    Oct 11, 2010
    Posts:
    605
    There are problems, but they are easy to fix though.

    In a usual pool system:
    You allocate and reuse already allocated objects that you don't use anymore. If your pool of object is not big enough, you allocate more in realtime.
    You can of course decide by hand how much you allocate at start what you need to avoid realtime allocation. But a sound not played with the default setting, when you call play(), it's a bug. (A sound manager is there to handle this automatically, and if you want to optimize for your game, you can change the default setting, that's not the other way around)
    Garbage collector only gives you problem, when you deallocate object, not when you only allocate object.

    You say an audio source object don't use memory, so why you don't allocate 10 objects for each sound group by default? Wouldn't this be better?

    For the bug:
    Did you configure it like I say, and try ? Or not ?
    I want to play a sound with a random delay at start, one variation, and this sound can be play several time at the same time.
    Impossible to configure with your system.
    The "clip change delay" property is only unlocked when you configure Looped Chain is on, don't ask me why.

    Does it really make sense that the weight, have the same effect than number of loop for you? I think it probably doesn't for most people.

    Weight, is a word usually use when there is random choice. The object with the bigger weight as more chance than the object with less weight to be picked. A trick is if you duplicate the object with more weight several times proportionally, and put it into the choice list, it will have more chance to be picked up. But this trick as no sens here. I think that's what you did. Buit it allocate real object, it is object have impact on the behave other modifying the probability !

    My Algo to handle weight and random:
    3 sounds:
    Sound A, weightA = 7;
    Sound B, weightB = 1;
    Sound C, weightC = 3;

    Add all the weight:
    7 + 1 + 3 = 11.

    RandomChoice = Unity.random.value * 11. (it will give you a number between 0 and 11)

    if ( RandomChoice < weightA )
    {
    play sound A
    }
    else if ( RandomChoice < (weightA + weightB) )
    {
    play sound B
    }
    else
    {
    play sound C
    }
    (of course it can be optimize, and using array)
    With this algo you don't need to duplicate sound object, to increase their weight.
    And as you never have more than 10 sound in most game, it's fast enough.
    weight are integer but they can be float, or percentage...

    The old sound manager, is actually my own.
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    It’s not a bug because it’s working as I designed it. It’s well documented in the online documentation and in a couple of the Youtube videos. If you consider it buggy that the warning isn’t logged by default, then I will turn that particular warning on by default. Just let me know.

    Why don’t we start with weight: 10? Because you may not need it, and then you may easily unintentionally run into the 32-voices Unity limit with a couple spammy SFX and be asking me a different support question (why do I only hear my 2 SFX and nothing else?). I think it’s better as is. There are other Sound Group Templates you could be using instead of the default one, that have higher Weights, such as “Single Variation 10 Voices”. Go ahead and select that if you like that default.

    I’m not saying this has a pooling system. I’m saying that it avoids inconsistent frame rates and GC like a pooling system does. In general, allocating more in realtime is a risky practice and can cause frame skips, especially on mobile devices. Most games made with Unity are mobile.


    I want to play a sound with a random delay at start, one variation, and this sound can be play several time at the same time. Impossible to configure with your system.


    Nope. There’s a section on each Sound Group’s Variation called Use Random Delay. Open that up and choose a random min / max and then set your Weight. I think you have some misunderstandings on how to use our product.

    I’m not sure you understand what the purpose of Looped Chain is for, with your comments on them. What are you trying to do specifically?

    Notice that the Weight field is labeled “Voices (Weight)”. It serves dual purpose, as the documentation states. It does indeed work as probability. We do need to create a new game object for each weight past the first because this is how we limit the number of simultaneous voices (since you can only have 32). It sounds like you'd rather have 2 different fields, one for Weight and one for Voices? I don't see why that's any better.

    By the way, there is an API method to create at runtime a new Variation with an AudioClip you specify, into an existing Sound Group. You could use this to change the weight I suppose, although I have no idea why you wouldn’t know up front how many voices you need.

    I’m not sure why you are elaborating with the code there because probability already works in Master Audio.

    Also: we've added a new field for the next update, called Probability To Play. Each Variation has this field (defaults to 100%), but you can set it from 0% - 100% and basically when the Variation is selected (randomly or otherwise), it will generate a random number and see if it passes your percentage test. If it does, it will play. If it does not, it will be a "silent play". Not sure if that helps you or not.
     
  40. Wild-Factor

    Wild-Factor

    Joined:
    Oct 11, 2010
    Posts:
    605
    As soon as someone complains: "it's in the video", "it's in the doc", "you like another lib, it's because you didn't use my lib properly". You didn't ask yourself if your lib is just too complicated to use for what it does? Well the problem is that it is a sound lib, it should be F*** simple as hell to use. No doc needed.
    Your lib is fabulous, ok, but why do people choose another lib after trying yours? because they want a feature other product have and your lib doesn't? No. Is it because they are dumb? No. Or because, people just didn't understand how to use your lib, when they were able to do it, without ready the doc, with other sound lib? Yes.

    I should be able to configure a basic sound setting, without watching a video, don't you think?
    We are not talking about sound occlusion, dynamic music, ambiance area. Playing sound, some time random delay, pitch etc.. Sometimes list of sound, choose randomly. Max 32.

    So when a field has two different purpose for the user, and you think it's not a flaw? That's a problem...
    2 fields is betters, no doubt. because the weight shouldn't create new sound objects. It just should do what it says, increase the weight in the probability. Nothing more, nothing less. Does that make sense to you ?
    I wanted to just change the weight, and it has an unexpected effect of also changing the voices when I didn't want to. Is it clear for you ? Can you try to sit in the chair of a user?
    (It's called the user-centric approach...)

    When most user saw a var called "voices (Weight)", he asks himself in his head, what the F*** this thing do.

    Why you don't simply have 2 var:
    - Weight
    - Max simultaneous

    So I can have sound that have a weight of 32, and I want this sound be played only 5 times simultaneously.
    -> impossible as these two vars are linked. S*** I should have watch the video ;) This really feels like a hack in your code, that the user should read the manual to understand how it works.

    I configure one sequence of one sound, loop one time. I set the voices to 10, because I wanted to play it 10 times simultaneously. I hit play, and it doesn't do what I expect. Do you understand what I'm saying?
    If your design is flawless, I should have heard a sound played one time, with a random beginning. And be able to play it 10 times simultaneously? And there is no reason, why it's not working like that. Every box in your interface says that's the behave I should expect.
    But your lib doesn't work like that internally. And the user needs to read the manual to overcome a problem that shouldn't exist in the first place (or send you an email...)

    I'm focusing on this var, as an example, but there is a lot of other things like that in your interface.

    You should really up your game and start listening to your user. And you will get a lot, I mean A LOT less support to do. But maybe you like to solve problems you've created. I don't know.

    Sound Manager Pro seems a lot better in that area (I have no interest in them), from their video...
    sorry to say that! But I didn't try it for now. And feature wise I didn't compare.

    You probably think that I'm a jerk, but I just want to open your eyes, on some user demand (I saw them on your forum, and here), that are 100% legitimate.

    I will go back and use my own lib...
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    I hadn't thought previously about making it 2 separate fields, Weight and Max Voices. No one ever made the suggestion until now. That sounds like a good idea. I do get someone asking this question about once every 2 months (why is the Sound Group only playing 1 voice?) and I couldn't think of a good way to fix it so it was understood aside from adding documentation. But that only works if people read it.

    I'm open to the idea as long as we're not talking about creating additional Variation game objects after the Awake event, since otherwise that's risking occasional slow frames. Is that acceptable?

    Regarding your 10 voices comment, if you have Looped Chain on, then no: it won't work. The Inspector even says in bold "in this mode, only one Variation can be played at a time" up there by where you selected Looped Chain. You probably missed this somehow if you were surprised to only hear 1 voice. So you don't need to watch any videos or read any manual or contact me with emails or forum posts. If you don't have Looped Chain on, it does indeed work as you thought. Well - what does Looped Chain even mean? For that, you probably want to click the green icon and read what it does. Should I add an Inspector explanation here for that?

    Also, yes you already can have Weight of 32 and limit it to 5 simultaneously. There's a Limit Polyphony option on the Sound Group (not quite as granular as you want, I realize) but it may do the job.

    We don't actually get may support requests, it's fairly self-sustaining. Sound Manager Pro is fine for what it does. I'm not going to knock it. Much less power, but yes easy to use. The videos however are super long and rambling - ours are focused and short. We actually watched some and decided how *not* to make a video. But for free, can't go wrong.

    We also have the best online help docs in the entire Asset Store - those little green icons in the Inspector link you to the exact page or section you want to see if you need to know "what the heck is Weight / voices"? Did you click the green icon? It's infinitely better than opening a 60-page PDF and trying to find what you're looking for.

    Why do people choose another lib after trying ours? You might be the first person to do so, we have no idea. There's definitely nothing but great reviews on the Asset Store page, see for yourself.

    Sound Managers are supposed to be simple to learn? Tell that to industry standards FMod, WWise and yeah even Fabric. Very very complex and in-depth. A long time to learn them. There is a certain usability trade-off unfortunately when you reach a certain threshold of options. Ours is easier than any of those for sure. Always room for improvement though.

    I value your feedback, and you do sound more than a little upset, but not a jerk. I would like to hear what else in the UI you found confusing. We don't want to do support for no reason or because we seem too lazy to fix it.

    Hope to hear back,

    -Brian
     
    Last edited: Jun 27, 2017
    Dwight_Everhart likes this.
  42. chris-gunn-qs

    chris-gunn-qs

    Joined:
    May 3, 2017
    Posts:
    2
    Hi There. Thanks for the great work on the plugin and its really cool to see someone really engaged with us users with feedback/help etc !

    I wondered if you could please help/advise on the Audio Occlusion settings within Master Audio.

    It appears that these settings are global, so when "Use Occlusion" is selected, these settings, including the settings for Min/Max Cutoff Frequencies, are global for all the objects marked for Occlusion using the Ambient Sound script attached to them.

    Is there any way, or would it be possible to have a "per object" control of its Min/Max Cutoff frequencies to give more flexibility over the control of this change per object, rather than treating every sound with the same roll off characteristics ?

    Thanks again for your time and help

    Kind Regards
    Chris
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    There is a global setting yes, but you can already override it at the Sound Group level. If you don't override, then the global setting will be used for that Sound Group. Go to the Sound Group and look in the Inspector for the Occlusion section.

    Screen shot below.

    Sounds like you want it per "object" meaning the Game Object you have the script on, but that's not going to be possible. Group should work for you.
     

    Attached Files:

    chris-gunn-qs likes this.
  44. chris-gunn-qs

    chris-gunn-qs

    Joined:
    May 3, 2017
    Posts:
    2
    Hi,

    Thanks for the reply. That's great and that will solve it !

    All the best

    Chris
     
    jerotas likes this.
  45. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,156
    Hey @jerotas , I pmed you about an issue, hope thats ok :)
     
  46. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    Cool, will read it soon and reply.
     
  47. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    155
    Hey Brian, I am just in the middle of trying to sort out music/bus volumes and PlayerPrefs. This is my first time tinkering with PlayerPrefs so please forgive my noob-level knowledge. To cut a long story short I have a persistent MasterAudio prefab. I have UI sliders working with EventSounds scripts as per your previous suggestion. However I have a couple of questions...

    1. With regards to the Playlist Volume I am not sure whether to do either MasterAudio.PlaylistMasterVolume = PlayerPrefsBlahBlahBlah, or, PersistentAudioSettings.MusicVolume = PlayerPrefsBlahBlahBlah. I am setting one of these up to load in an Awake function on each scene.

    2. I am also trying to work out how to sort PlayerPrefs for a Bus Volume ("EnvironmentSFX"). i.e.: MasterAudio.SetBusVolumeByName(volume, "EnvironmentSFX") = PlayerPrefsBlahBlahBlah. With this one I am just not sure where the float 'volume' is coming from (like should I perhaps have EnvironmentSFXSlider.value as the float).

    Any info or assistance is greatly appreciated as always :).
     
  48. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    I think you're thinking too much here. Let the plugin do the work for you.

    #1, if you set PersistentAudioSettings.MusicVolume to something - ever - then in the Awake / Start event of every Scene, it will automatically be re-set to that volume. That's how PersistentAudioSettings work.

    #2, same if you use PersistentAudioSettings and set a Bus volume, during each Scene Awake, it will be set to that again.

    Yes, you should set these with a slider value. If you use the Event Sounds script, you can do this without writing any code. Just add it to the game object with the slider and select the Slider Changed event. Then tell it to set Persistent Audio Settings, choose the appropriate command from the dropdown.
     
  49. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    155
    Hey Brian, thanks for that info I think I am on the right track now. The underlying problem that I had was that if I changed the music volume at runtime it only saved the prefs for that and not the actual visible slider position so I needed to add an extra line of code to get around that.

    "I think you're thinking too much here."

    LOL!!! That's the story of my life trying to do any coding over 30 years or so. I seem to be able to work out the logic of what I want to do in my head or on paper but when it comes to actually writing the code I often end up going around in circles and end up with half a working solution and then the opposite of the solution.

    A few times now I have wasted an hour or so trying to sort something audio related in code and after failing miserably I remember the Event Sounds script and it solves my problem in seconds.
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,144
    Haha, well I'm glad you're sorted now. I get the issue here, that makes sense and would be confusing.
     
unityunity