Search Unity

[RELEASED] SoundManagerPro: Easy Game Music Plugin

Discussion in 'Assets and Asset Store' started by AntiLunchBox, Jun 12, 2013.

  1. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Sorry the update is taking so long guys, it'll hopefully get approved soon. Seems like a slow week.

    -alb
     
  2. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Well!

    Lately, I have been focused on a new plugin since the questions have slowed a bit. Thus I haven't had a chance to take a look at how SoundManagerPro is doing for a while (we're still going strong!). So I only just saw all the great reviews people have left and I wanted to say:

    THANKS!

    I just hope to be able to keep creating awesome products! And as SMPro is closing in 1,000 downloads, I'll think of something special to do. Happy Game Making,

    -ALB
     
  3. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75
    how do I use this in Playmaker?? Is there a tutorial somewhere I cant find any documentation on it and im trying to make a sound connection but it's asking me fore a variable. We'll I dont know what kind of variable it needs and there is no documentation on the create soundconnection action in playmaker... What do I do? I tried placing "add soundconnection" in my FSM and It too is looking for a variable. I'm really confused as to how I can use this with playmaker :-/ Is there a youtube video that walks through the various actions available for use with playmaker? I see a whole list of actions here but I see no documentation on how they work with playmaker...
     
  4. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75
    I created a game object in a scene and placed the prefab "sound manager prefab" on it. I then dragged a few mp3's into the sound player list and then i tried to play the scene. Now everytime i try to load that scene unity crashes on two different computers. I just lost that scene and about an hour and a half of work that I did on it. So that's very disturbing... Boy I wish there were some tutorials about how to use this with playmaker now! I even deleted the sound Manager folder from the assets folder and it still crashes on the scene that I used the sound manger on...
     
    Last edited: Aug 23, 2013
  5. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey acriticalstrike,

    If you hold your mouse over the items, it'll show a tooltip description about each variable. The same goes for descriptions of each Action in the Action list. But I'll explain it the best I can without looking at it (I'm not at my computer right now):

    So you can either CreateSoundConnection on the fly with the action, OR create it on the SoundManager prefab.

    When you use the CreateSoundConnection Action, you should create a Variable of type Object to hold the SoundConnection (in the Variables tab). Then in the CreateSoundConnection action, select the variable you created along with the clips you want, etc. Then you can either Add that variable to the SoundManager prefab with Add/ReplaceSoundConnection or Play it with PlayConnection. That Variable you created is meant to hold the SoundConnection. It's just like using Variables with other Actions.

    -ALB
     
  6. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hm that's strange, I haven't heard anybody else encounter an issue like this. What version of Unity are you using, and what's your computer's OS? One guy did have a similar issue with making the SoundManager a child of another object so it's probably related. Check to see if the demo scene works for you, that should be a tell tale sign. I'm looking to fix this bug, so for now I'd say don't parent it to anything. This behavior didn't happen for him so it wasn't high on my priority list, but now it is! Sorry about losing your work. I would try just restarting Unity as well. The serialized data (used to save data about prefabs and scenes) probably somehow got corrupted. If you can send me the invoice number of your order, I can verify it and fix it this weekend. Then I'll send you a personal update with the fix.

    I am making more videos, so I'll include some PlayMaker videos if that helps. The tooltip descriptions should be useful if you didn't know about them.

    -ALB
     
    Last edited: Aug 23, 2013
  7. GPSchnyder

    GPSchnyder

    Joined:
    Mar 23, 2013
    Posts:
    45
    Hi there,

    I have a little Prob. I've produced a set of 22 longer loops (14 Sec. to 44) that can be played in any order and match perfectly to the others. It shall be used to produce never ending Backgroundmusic that is purely randomly. I used the Soundmanager Prefab, added all loops and set the crossfade to 0. My idea was that it now should loop seemlesly. However Soundmanager Pro seems to cut the last half beat of the Loops, making it choppy there. Any Idea what to do? The Loops are cut perfectly to match the ending of the one loop to the beginning of the next.

    George
     
  8. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey GPSchnyder,

    Would you mind PM'ing me 2 or 3 of them so I can test it out on my machine? It'll give me a better picture of what's happening. I'm headed home right now and should be there in 30 minutes. I'll be able to give you a better idea of what to do then.

    -ALB
     
  9. GPSchnyder

    GPSchnyder

    Joined:
    Mar 23, 2013
    Posts:
    45
    I'll send you the Links as a PM, thanks.
     
  10. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    No problem, I just got home so I'll look at it now. I strongly suspect that there is 1 frame in between playing songs. As it stands, with a 0sec crossfade, SMPro waits for the song to stop playing before starting the next. So there would have to be a frame where SMPro sees that the song isn't playing before moving on to the next one. Solving that is a bit tricky since deltaTime is a varying variable, which also varies per device.

    Besides maybe setting the crossfade to .01 (i'd say that is about the average value of deltaTime), there may not be much to do. I'm looking into it though.

    -ALB
     
  11. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey GPS,

    At the end of each of your audioclips I found some extra silence there. I opened them up in audacity to make sure:

    $skipatend.png

    I tried putting multiple tracks right after one another and it still skipped in Audacity. If you could send me new ones that'd be great.

    -ALB
     
  12. GPSchnyder

    GPSchnyder

    Joined:
    Mar 23, 2013
    Posts:
    45
    I see, Changed that. Just redownload with the links I've send you. But the Problem is that the next loop starts to early, not to late, so I didn't hear the End of any of that loops :) I's like the last Second or maybe a half is skipped. So the Loop plays like 13 to 14 Secs, but then skips to the next loop abruptly. The Loop is 14.770 Secs, and I'd say maybe it skips at 14 secs straight, or 0.500 secs upfront.
     
  13. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Ah, I'm pretty sure I found it. It's some integer division that should be float division. So it's cutting off that remainder. Thanks for finding that! Will post the fix soon.

    -ALB
     
  14. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey all, I will be including this fix in the update after next (I'm not going to submit it yet because it will overwrite the pending update and reset the release date).

    If you're interested in having it, PM me and I'll send you the fix.

    -ALB
     
  15. GPSchnyder

    GPSchnyder

    Joined:
    Mar 23, 2013
    Posts:
    45
  16. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    BTW, acriticalstrike.

    I found the fix for the parenting issue. In SoundManagerEditor.cs in both "Enable()" and "Disable()" functions,

    replace:
    Code (csharp):
    1.  
    2. if(script.GetComponent<Transform>().hideFlags != HideFlags.HideInInspector)
    3.             script.GetComponent<Transform>().hideFlags = HideFlags.NotEditable | HideFlags.HideInInspector | HideFlags.DontSave;
    4.  
    with:
    Code (csharp):
    1.  
    2. if(script.GetComponent<Transform>().hideFlags != HideFlags.HideInInspector)
    3.             script.GetComponent<Transform>().hideFlags = HideFlags.NotEditable | HideFlags.HideInInspector;
    4.  
    I'll be including this in the following update as well.

    -ALB
     
  17. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75
    Well I encountered some strange behavior I think the reason may have been because I was actually working on the build over the network. I was using my desktop to modify the build that was located on my laptop. About a day after this i had another error where the data was corrupted, it wasn't saved right... Maybe it had nothing to do with sound manager pro. I'm thinking I should only work on a build that is on my local machine from now on. We'll see what happens. I will try the sound manager pro again soon. I do need to add more sounds to my game. I will let you know if I get it working again, I'm just not at the point in my game where I need sound yet. I've got a laundry list of things I need to finish before that point. I'm sure the sound manager pro will work great when I try it again. I see plenty of people using it without a problem so I bet it was a network bug or something. Also please do make some videos about Playmaker my partner and I use it so much that it's truly an invaluable asset to our projects.
     
    Last edited: Aug 24, 2013
  18. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Well when you get a chance, try the fix I posted above. It should fix that problem. Good luck,

    -ALB
     
  19. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    I just started using Sound Manager Pro a couple hours ago. But I have run into a couple issues. Hopefully just newbie foolishness.

    Problem 1: Index out of range issue.

    I have soundmanagerpro on my main menu scene. When I load another scene then load the main menu scene again i get an index out of range error.

    I believe this error is occuring because the SoundMangerPro prefab is on the main scene and this forces the soundmanager classes to get created when this scene loads. The sound manager classes are intended to be persistent, they are a singleton with DontDestroyOnLoad. However, what I have found with persistent singleton classes is that if you have them on an object in the scene hierarchy, they get destroyed and created again when you load that scene.

    Issue occurs in checkwhosplaying. The audios array is empty.

    private int CheckWhosPlaying(){
    if(audios[0].isPlaying) return 0;
    else if(audios[1].isPlaying) return 1;
    else return SOUNDMANAGER_FALSE;
    }

    Here is the call stack when crashes.

    IndexOutOfRangeException: Array index is out of range.
    SoundManager.CheckWhosPlaying () (at Assets/SoundManagerPro/Scripts/Managers/SoundManager_Internal.cs:133)
    SoundManager.PlayClip (UnityEngine.AudioClip clip2play) (at Assets/SoundManagerPro/Scripts/Managers/SoundManager_Internal.cs:350)
    SoundManager+<PlaySoundConnection>c__Iterator25.MoveNext () (at Assets/SoundManagerPro/Scripts/Managers/SoundManager_Internal.cs:750)
    UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
    SoundManager:HandleLevel(Int32) (at Assets/SoundManagerPro/Scripts/Managers/SoundManager_Internal.cs:162)
    SoundManager:OnLevelWasLoaded(Int32) (at Assets/SoundManagerPro/Scripts/Managers/SoundManager.cs:24)

    Problem 2:

    I have 5 songs in my song list. But only the first 2 get played. They loop nicely, but the sound manager doesn't seem to be aware of the last 3 songs. I haven't bothered looking into this yet, because I am little frustrated having spent last hour and half looking at the index error above.
     
    Last edited: Aug 25, 2013
  20. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Just another quick question. I would like to have a small delay in between the songs in the song list. I thought the cross duration might do what I want, if I could set this to a negative value, however this is always forced to 0 or greater.

    My only option is to have a 0 or larger value which even with a 0 value seems to cut off the end of one song and fade in a new song.

    Is there any way to have one song start after another song finishes with a small delay in between?
     
    Last edited: Aug 25, 2013
  21. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey Zaddo67,

    Yes in the documentation right now at the top it says to not set the SoundManager prefab a child of another. When you destroy the parent (in this case the scene destroys it), it also destroys it's children. DontDestroyOnLoad will not prevent an object from being destroyed if the parent gets destroyed:

    So you options are to unparent the SoundManager prefab OR set the parent to also DontDestroyOnLoad. If you do end up setting the parent to DontDestroyOnLoad, please include this fix that is coming in a future release. Also in SoundManager.cs, in OnLevelWasLoaded(), use this:
    Code (csharp):
    1. if(Instance == this)
    2.             if(!ignoreLevelLoad)
    3.                 HandleLevel(level);
    That error was coming up because that function gets called before Awake in this particular case for some reason.

    -ALB
     
    Last edited: Aug 25, 2013
  22. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey again Zaddo,

    When you make a SoundConnection, there are a couple different PlayMethods you can choose that include a delay or random delay amount in between songs. If you click EDIT on your existing SoundConnections on the prefab, you can change the playmethod and assign whatever delay values you want so you don't waste time recreating them.

    Crossfade and delay are different variables.

    -ALB
     
    Last edited: Aug 25, 2013
  23. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    As for this issue, this seems strange. Could you please PM me the following information:

    -If you could recreate this issue in the Demo Scene
    -Version of SoundManagerPro you are using
    -Unity Version
    -OS
    -The 5 songs you are trying to play

    And I'll get back to you.
    -ALB
     
  24. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Thanks for prompt response ALB. I have send you a PM and link to sample project with steps to reproduce issues.
     
  25. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Thx ALB. This fixed the index error.
     
  26. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hi all!

    Due to some delays in the Asset Store, this update came out a little later than intended. But it's finally out!

    And along with the new update, SoundManagerPro is on a temporary crazy exclusive sale! Get it now while you can!

    Now with the update features...

    $forum info new sfx group feature.png

    Changelog in 2.6.2:
    • New feature: SFX Groups! Current SFX Group features include: Pick SFX at random from within group; Set individual SFX caps per group;
    • Unity 4 warnings removed
    • Added a 'Check For Updates' feature in the AntiLunchBox menu. It will take you directly to the Asset Store page to update. If a new update is available, it will also automatically debug update alerts to you when you open your project.

    I will be updating the documentation to reflect SFX groups tonight.

    Additionally, now that this update is finally posted, I will submit the update with the fix to the float division and a fix to allow SMPro to be parented to other objects (for those who want to do that).

    In the update after that, event triggers will be added along with an audio channel feature to SFX groups. Happy gamemaking,

    -ALB
     
    Last edited: Aug 26, 2013
  27. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Cant' wait for the event triggers :D

    Thanks for this awesome plugin, such a pleasure to work with!
     
  28. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Thanks! I try!

    I'm going to be updating the tutorial/promo videos (at least some of them) tonight. I'll let you guys know when that's up.

    -ALB
     
  29. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey guys, the documentation has been updated with the section on SFX Groups.

    Enjoy!

    -ALB
     
  30. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey guys!

    Here is a sneak preview of the first video about SoundManagerPro. It is a general information video but the in-depth tutorial about SoundConnections will be uploaded tonight. It just needs to finish uploading to Youtube.

    There will also be an in-depth tutorial about SFX that just needs to finish the editing phase. Hope you like the videos.

    -ALB

     
  31. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    And because you guys asked, here is the first In-Depth video on SoundConnections:



    Enjoy! In-Depth SFX coming soon!
     
  32. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey guys, next update will be including a hotfix for ios builds. It was caused by a recent update. It doesn't affect everyone, but if you are making ios builds be sure to download the next update.
     
  33. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Hey ALB,

    just wanted to mention: when I restart my level I got this error:

     
  34. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey mayhem,

    I'm currently not at my computer but can I ask if you are using a SoundManager function in Awake? That error usually comes up in that case.

    -ALB
     
  35. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    No, I don't. Actually, I'm not using any code for SoundManager for now. It's just the inspector-script, I ran the game, reloaded the scene in the game (PlayMaker function: Restart Level) and the error occured.
     
  36. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    K I'll check out playmakers restartlevel as soon as I get home.
    -alb
     
  37. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey Mayhem,

    With the SoundManagerPro debug logs on (check 'Show Debug Info'), I noticed that PlayMakers call to Restart Level is loading the level twice immediately (which is making SoundManagerPro essentially run it's functions in Awake on the second load). You might want to contact them about that, because I'm sure that's not intended behavior.

    Let me know if that's not what's happening to you. With the Debug logs on, it'll show something like this:
    If that shows up twice exactly the same(the number in parenthesis is the time it is called), then something is wrong with their restart level.

    -ALB
     
  38. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    The update is live now! download away! I will be posting the changelog in a bit.

    -ALB
     
  39. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    I looked it up and got this one:

     
  40. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    As in:
    Sorry if that was confusing. So in your Console, check to see if you see this twice:

     
  41. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Oh, sorry, I forgot to mention it: Yes, I can see it twice!
     
  42. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Yeah, that's definitely a bug with PlayMaker then.

    -ALB
     
  43. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey all!

    PlayMaker is on a daily deal today in case you want to pick up SMPRO + PlayMaker for pretty cheap!

    -ALB
     
  44. Hesham

    Hesham

    Joined:
    May 29, 2008
    Posts:
    147
    Great combo indeed
     
  45. GPSchnyder

    GPSchnyder

    Joined:
    Mar 23, 2013
    Posts:
    45
    I'll get Playmaker, but can you give a short overview what we can do with Playmaker and SMPro together? What Actions are there to use, or can you link me to a tutorial/manual?
     
  46. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    ALB covered almost the complete Method-Set of the Plugin. You can create Soundconnections, add them, play Songs or Soundfiles, set volume/pitch/and more stuff with the PlayMaker-Actions.
     
  47. GPSchnyder

    GPSchnyder

    Joined:
    Mar 23, 2013
    Posts:
    45
    Nice. This indeed ist a must have then. And as playmaker seems to rock anyhow it looks like money wisely spend.
     
  48. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Thanks for answering for me, guys!
     
  49. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey all,

    Version 2.6.6 is available on the Asset Store. It contains a hotfix for an editor bug introduced last update if you press play while looking at SoundManager.

    Happy Game Making!
    -ALB
     
  50. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    I just bought the product, it is really nice!

    I have one question.

    I have around 15 scenes (GameScene, SettingsScene, etc..) and I have 3 musics. I just want to play shuffle this 3 musics throughout the app without any change when user moves between scenes.

    If I add all scenes separately with sound-connection, when user move between scenes, current music fades and with new scene new music starts. I just want to keep musics without any change between scenes

    Regards.