Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Audio Toolkit v2.2 (+object pooling class) launched on Asset Store

Discussion in 'Assets and Asset Store' started by Michael-ClockStone, Jan 18, 2012.

  1. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    @bfowle: We didn't design the pooling to work with object placed by the editor. I agree it would make sense though. I will see to find a solution for this situation. You can safely ignore the warnings during the meantime.
     
  2. bfowle

    bfowle

    Joined:
    Oct 1, 2012
    Posts:
    23
    @clockstone: Thanks for taking a look, that'd be a great feature to have. I just realized I posted to the wrong thread (I subscribe to the v3.0 one). :) Cheers~
     
  3. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    582
    Since I updated to Unity4.1.2 (at least that is when I think it started) I'm getting this warning:

    "Delayed playback via the optional argument of Play is deprecated. Use PlayDelayed instead!"

    It warning indicates "audio.Play(d") in the code below is the cause. Is there a planned update that will fix this? Thanks.

    Code (csharp):
    1.  
    2.     private void _PlayInitial( float delay )
    3.     {
    4.         //Debug.Log( "_PlayInitial:" + audioID + " sub:" + _subItemID );
    5.  
    6.         if ( !audio.clip )
    7.         {
    8.             Debug.LogError( "audio.clip == null in " + gameObject.name );
    9.             return;
    10.         }
    11.  
    12.         ulong d = (ulong) ( ( 44100.0f / audio.clip.frequency ) * delay * audio.clip.frequency ); // http://unity3d.com/support/documentation/ScriptReference/AudioSource.Play.html
    13.  
    14.         //Debug.Log( "Play Clip:" + audio.clip.name + " S/N:"+ GetComponent<PoolableObject>().GetSerialNumber());
    15.  
    16.         audio.Play( d );
    17.  
    18.         _playInitialTime = Time.time;
    19.  
    20.         _destroyIfNotPlaying = true;
    21.         _paused = false;
    22.     }
    23.  
     
  4. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    I will submit a major update of the Audio Toolkit today (v6.0) which fully supports the new features of Unity v4.1. Now it's e.g. possible to create chains of audios stiched together gaplessly. I'll post a detailed update log soon.
     
    Last edited: Apr 2, 2013
  5. bigdaddy

    bigdaddy

    Joined:
    May 24, 2011
    Posts:
    153
    Bought the toolkit earlier this week and it was a snap to put in all my sound effects. The Random mode for sub-items really helps the various units not sound cookie cutter.

    But my question is on Audio Item volume % setting. I have a couple of sound effect clips that overpower other effects. If I set the audio items volume to example 60% for these loud sound effect, then if the user lowers the sound effect volume (using a slider) for all sound effects (the audio category) down to say 50%, will the net effect of the loud sound effects be 30%? Also if the "all sound effects" volume is moved back up to 100% will the loud sound effects still be 60%?

    Thanks
     
  6. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    @bigdaddy: Yes, that's exactly how it works. Volume percentages multiply with each other. If you set your audio item to 60% than that's the maximum volume it can have.
     
  7. Backward pieS

    Backward pieS

    Joined:
    Feb 7, 2013
    Posts:
    20
    Can you describe how one would use Audio Toolkit to manage music that plays from one scene into another?

    Specifically, after the player chooses what level they would like to and the game/music starts, if he restarts the level, I want the music to play continuously. And if the player completes the level and next level uses the same music, it should play continuously. If the next level uses different music, I want to cross-fade between the two. Returning to the main menu would simply cause the current music track to fade out.

    I've been reading up on Singleton behavior, but have not had any success using it to control music properly. If Audio Toolkit requires an understanding of Singleton (that isn't simple), I'll probably be right back where I started. :)
     
  8. ClockStoneAdmin

    ClockStoneAdmin

    Joined:
    Sep 1, 2012
    Posts:
    56
    @Backward pieS: If you disable the "Stop When Scene Loads" checkbox in the music audio item the music will continue to play even if you load the next scene.

    You can simply call AudioController.PlayMusic(...) and the currently playing music will cross-fade to the new one according to the cross fade settings of the AudioController.

    You don't have to bother about the singleton concept. Just make sure there is always an AudioController present. You can achieve this by having a persistent AudioController object in your start level (the recommended way), or you could have a seperate AudioController per scene. (Or even multiple controllers marked "additional". This is useful if you have a large amount of audio data and you don't want all audio to be in memory in all scenes)
     
  9. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,311
    I bought this the other day when it was on sale. The demo project is broken; the prefabs in the scene and in the project folder are missing their scripts; I'm guessing they got renamed or changed at some point and the demo wasn't updated?
     
  10. delphinius81

    delphinius81

    Joined:
    Mar 6, 2012
    Posts:
    56
    Just wondering, is it possible to build the Category and AudioItem content at run-time? We have downloadable audio content that we want to integrate into the audio manager, and we want to be able to add this at run time, rather than through the editor.
     
  11. ClockStoneAdmin

    ClockStoneAdmin

    Joined:
    Sep 1, 2012
    Posts:
    56
    Sure - you can use the AudioController.AddToCategory(...) and AudioController.NewCategory(...) methods
     
  12. FossilSoftware

    FossilSoftware

    Joined:
    Aug 6, 2013
    Posts:
    2
    We've been using AudioToolkit for 10 months. It's superb :)

    I updated to 4.2 and one of our sounds stutters when it starts 50% of the time. At first I dismissed it in editor, then when I could reproduce it on the iPhone I started to think something had changed. I'm using Audio Tookit 5.3 btw, we've been in dev for 10 months with this same sound so it was easy to take note that stuttering appeared with the 4.2 update. What I've narrowed it down to is the PlayDelayed function that Audio Toolkit eventually calls. This particular uncompressed wav file is played via AudioController.Play("mysound",1,.3f) with a .3 second delay. If I remove the delay and play immediately I have no problems.

    Now that I've tracked it down, I'm wondering if anyone has any suggestions for me? I cooooould update to Audio Toolkit 6.1 in case there are changes there that would fix this (didn't see anything specifically in the release notes however) but hoping to avoid that since we are very close to shipping. Also you might wonder why .3? it's such a small delay. But it's done so to time with visuals.. fine tuning.

    Anyone else experiencing this since upgrading to 4.2 when it came out?

    Thanks!!
     
  13. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    582
    I never pinpointed it to the 4.2 update, but I did notice, around that time frame, a change in the audio in my game... It didn't start up or transition the same way it had... a stutter would probably be a valid description.

    I never really figured out how to fix it. I just kinda adjusted where my sound was starting in order to minimize it.

    -Jeff
     
    Last edited: Oct 15, 2013
  14. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    582
    On iOS I've noticed that recently an audio bug was introduced into my app. I'm still digging into it to see if it happens on iOS6 and iOS7 (only noticed it on iOS7 so far).

    What happens is when the app starts the audio works as it should but if a user hits the iPhone home button to soft-close the app, then they re-open it the audio does not resume. As far as I know, I have not touched any of the code for audio in quite a while.. it's been working great.

    Anyone else seeing this?
     
  15. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    Both mentioned issues look like a Unity or FMOD bug, maybe you should report to the Unity devs.
     
  16. schragnasher

    schragnasher

    Joined:
    Oct 7, 2012
    Posts:
    117
    hello, i am trying to write a coroutine to change music and yield until the new music has completly faded in. But i seem to have issues with isFadingin/isFadingOut not changing when a fade completes, does anyone have a snippet that works?
     
  17. ClockStoneAdmin

    ClockStoneAdmin

    Joined:
    Sep 1, 2012
    Posts:
    56
    @ schrabnasher: You are right, there is a bug which will be fixed in the next update. You can fix it right now by changing isFadingIn in AudioFader.cs to

    Code (csharp):
    1.  
    2.     public bool isFadingIn
    3.     {
    4.         get
    5.         {
    6.             if( _fadeInStartTime > 0 )
    7.             {
    8.                 return _fadeInTotalTime > 0  time > _fadeInStartTime  ( time - _fadeInStartTime ) < _fadeInTotalTime;
    9.             } else
    10.                 return _fadeInTotalTime > 0  time < _fadeInTotalTime;
    11.         }
    12.     }
     
  18. awejk

    awejk

    Joined:
    Oct 13, 2012
    Posts:
    32
    Is it possible to create preloaded audio objects with real audio of file? I do not mean the property "Preload Count" of prefab AudioObject, because it creating empty AudioObjects. And when I play sound, it loading into memory, assign it to created AudioObject and then playing, because of it i get allocation of memory. I mean preload AudioObject - create realy audio object in the scene with real audio file. And play it, without invoking allocation of memory.
     
  19. eedok

    eedok

    Joined:
    Sep 21, 2009
    Posts:
    194
    with Unity 4.5 it seems the console gets spammed with this from AudioToolkit:
    Code (csharp):
    1. Serialization depth limit exceeded at '::AudioItem'. There may be an object composition cycle in one or more of your serialized classes.
    2.  
     
  20. TriplePAF

    TriplePAF

    Joined:
    Aug 19, 2009
    Posts:
    246
    I had this too but it disappeared after closing unity and reopening it.



    Peter.
     
  21. TriplePAF

    TriplePAF

    Joined:
    Aug 19, 2009
    Posts:
    246
    Hmm... the "Serialization depth limit exceeded at '::AudioItem'. There may be an object composition cycle in one or more of your serialized classes" is back after building the project.
     
    Last edited: May 27, 2014
  22. Backward pieS

    Backward pieS

    Joined:
    Feb 7, 2013
    Posts:
    20
    I am getting the Serialization depth limit exceeded at '::AudioItem' error message as well.
     
  23. TheAdam

    TheAdam

    Joined:
    Jul 2, 2013
    Posts:
    4
    I emailed support about this, apparently they submitted a fix to the asset store that should be live soon.
    $fdsa.PNG

    (props to clockstone for the basically immediate fix)
     
  24. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    @bfowle: You are right, you can have pooled objects placed in the editor, but they don't go to the pool once deleted. That's the current design of the pooling system.
     
  25. GoesTo11

    GoesTo11

    Joined:
    Jul 22, 2014
    Posts:
    595
    Is there a way to jump to a specific item in a playlist? I have a play list of audio files that usually needs to start at item number 0 but sometimes may need to start part way through (e.g. item 6). Is there a way to skip to item 6 without just pressing next and previous? Thanks
     
unityunity