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

[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
    A video explaining the new features is coming out soon. As well as up-to-date documentation. Just figured I'd get it out first!

    ALB
     
  2. Stilghar

    Stilghar

    Joined:
    Feb 4, 2013
    Posts:
    82
    Yay!!! You're the best man! :D :D :D

    Let me know once it's there.
     
  3. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    Hi :) ,

    I have kind of sound problem, but I am not sure if it is related to SoundManager Pro. My game sounds and music perfectly works on Android, but not on iphone, ipad. Maybe you know the problem (maybe a fix in SoundManager Pro)

    Problems.
    1. On Iphone sounds/musics are not coming from normal speakers, sounds/musics comes from tiny speaker on front (where you hear people when you on call), so strange.
    2. On ipad there is no sound/music at all ?

    Is there a fix for this on SoundManager Pro, or should I look into something else

    Thank you

    Regards
    Mete


    EDIT:

    I heard that if microphone enabled, that iphone issue occurs, strangely app asks about "allow microphone" int the beginning, how to disable this permission ?
     
    Last edited: Feb 13, 2014
  4. cavila

    cavila

    Joined:
    Jun 4, 2013
    Posts:
    67
    I'm getting the following error with PlayMaker 1.7.7:

    The source:

     
  5. cavila

    cavila

    Joined:
    Jun 4, 2013
    Posts:
    67
    A few other ones:

     
  6. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    I'm getting a lot more crashes (like, full-on Unity hang and have to force quit) with SMP3 —*seemingly as a result of this construction in potentially rapid-fire situations (like, if a lot of enemies die at once).

    SoundManager.PlaySFX( SoundManager.LoadFromGroup( audioDeathGroup ) );

    My Sound Manager cap amount is currently 3 and object lifetime set to 5 (the seeming culprits of this have groups with 2-3 sounds and are set to "auto cap").

    EDIT: For some additional information, this most frequently seems to happen *after* a round of cleanup where previous similarly-named clips are destroyed due to inactivity.
     
    Last edited: Feb 14, 2014
  7. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    Yeah, setting the object lifetime to something like 30s (this is a fairly twitch-speed game) seems to make the crash much more rare.
     
  8. cavila

    cavila

    Joined:
    Jun 4, 2013
    Posts:
    67
    Made a few changes to the bundled PlayMaker actions to support fade in and fade outs.

    SetMusicVolume
     
  9. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Ah, I know what this issue is. I didn't update the PlayMaker actions. In SoundManager3, SoundConnections no longer have Objects as a base type. Will figure out a workaround for this.

    ALB
     
  10. cavila

    cavila

    Joined:
    Jun 4, 2013
    Posts:
    67
    Cool!

    I modified all Set*(Volume|Pitch) actions to support updates on every frame. I'm also adding some Stop* actions with fade out variants. e.g. (FadeOutMusic and so on). Not sure how interested would you be in adding them to the project. It sure would make it easier for me next time I import it :)

    I can paste the code here or send the files by email. Let me know.
     
  11. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Sure that'd be great to send by email. Always open to suggestions!

    -ALB
     
  12. AntiLunchBox

    AntiLunchBox

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

    Taking a look at this now. This is real bizarre, haven't gotten any reports of this. And SMP doesn't use the microphone at all. If you go to Project Settings>AudioSettings, what is under Default Speaker Mode???

    ALB
     
  13. AntiLunchBox

    AntiLunchBox

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

    The SFX Cap is only used when you use SoundManager.PlayCappedSFX. Otherwise it'll ignore the cap amount. It could possibly be that there's a bunch of sfx being played at once and its crashing the editor? I'll look into it though.

    ALB
     
  14. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    I debugged it a little bit last night; I assumed it would be something like a bunch of effects being played at once, but that doesn't seem to be the case. It does seem to be related to effects that get played the most, but the Unity hang (not even a crash) doesn't seem to be related to the amount of activity at any given time.

    My most reliable repro so far is actually playing the game like normal, then waiting for a bit (for SFX objects to be deleted due to inactivity) and then continuing to play more. Usually the Unity hang occurs most frequently when it starts to have to play SFX again. It's definitely unrelated to music, based on the testing I did.
     
  15. AntiLunchBox

    AntiLunchBox

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

    I have fixed the PlayMaker support. However, the Unity Asset Store server seems to be down and I can't commit. Will commit it when I can!

    ALB
     
  16. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    the playmaker fix is up now!
     
  17. cavila

    cavila

    Joined:
    Jun 4, 2013
    Posts:
    67
    Awesome, I just grabbed the update and it seems to work without issues.

    I couldn't find your email but here's a link with the changes I made to the PlayMaker actions provided with SMP: View attachment $SMP_PM_New_Actions.unitypackage
     
  18. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    Heya sir,

    So, I can say with some amount of confidence that the crash I'm experiencing is almost certainly related to playing a sound after a period of inactivity like I was alluding to earlier. If I play through a round of my game, no amount of craziness will result in a crash in-editor or on device, but if I then, say, chill at a pause screen while I get a drink before retrying the round in the same session, the first time I trigger one of the more common sounds (an impact effect), it will cause a hang in the editor and a freeze in-app on device.

    The same repro steps with SFX disabled has yet to result in a crash (even SFX disabled while music/sound connections are enabled don't result in a crash). And this is definitely new as of SMP3. My setup isn't too terribly complex either, since it's a relatively small project. That's about as useful information as I've had time to gather, though.
     
  19. CORPSEGRINDER

    CORPSEGRINDER

    Joined:
    Feb 6, 2014
    Posts:
    6
    Sir this is a critical bug. Our application suddenly hangs after a period of time playing. This only happened after updating to SMP3. You have to fix this ASAP. Even in Unity editor it still hangs.
     
  20. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
    How I can disable the update checker?
    I Hate it!
     
  21. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Yes, go to Tools > AntiLunchBox > SoundManagerPro > Turn Off Automatic Update Checks

    ALB
     
  22. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    I'm looking into this and trying to reproduce but not having any luck. From what mittense has told me, it's related to SFX. I've been trying to reproduce with the SoundManagerProDemoScene but haven't come across it. Does it have to do with AudioSourcePro?

    ALB
     
  23. AntiLunchBox

    AntiLunchBox

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

    As I was saying above, I'm trying to reproduce but not having any luck. I've been trying to reproduce with the SoundManagerProDemoScene but haven't come across it. Does it have to do with AudioSourcePro? Is that what you're using?

    ALB
     
  24. AntiLunchBox

    AntiLunchBox

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

    I've been building this out on a few devices and haven't had the microphone problem. SMP doesn't use the microphone. Did you check out the ProjectSettings/AudioSettings thing I mentioned earlier?

    ALB
     
  25. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Actually,

    The best thing you could do is provide me with steps to reproduce in one of the demo scenes.

    ALB
     
  26. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Actually,

    I think I was able to reproduce your problem. It happens when the prepool amount is 0. I'm looking into it now, but it should be pretty easy to fix now that I know what it is.

    ALB
     
  27. Stilghar

    Stilghar

    Joined:
    Feb 4, 2013
    Posts:
    82
    Hi Alb,

    Did you manage to update the documentation? What about what you mention regarding an easier way to do what I would like to do, any ETA?

    Many thanks!

    Stil
     
  28. AntiLunchBox

    AntiLunchBox

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

    Sorry I've been prioritizing bug fixes with SMP3. Just released the latest bug fix for the 0 prepool amount crash. The documentation update will come soon, since SMP3 is looking like its getting close to a stable state.

    ALB
     
  29. AntiLunchBox

    AntiLunchBox

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

    The bug fix is submitted!

    ALB
     
  30. AntiLunchBox

    AntiLunchBox

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

    The bug fix has been updated.

    ALB
     
  31. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    Thank you much; will try shortly to see if there are any further issues.
     
  32. Neterea Studios

    Neterea Studios

    Joined:
    May 7, 2013
    Posts:
    23
    Hi MoribitoMT,

    I had your same problem in a past project.

    That occurs if you set "Prepare IOS For Recording" in the iOS Settings in Unity. If you don't need the microphone you can uncheck this. If you need the microphone and enabling this is required you will need to have a look at this fix:

    https://github.com/cbaltzer/UnitySpeakerFix

    It will force the iOS device to use the external speakers, even if you enable the microphone. The last time I used it had a side effect: you will not be able to mute the sound with the physical button in the iPhone.
     
  33. Gavin1969

    Gavin1969

    Joined:
    Apr 30, 2013
    Posts:
    5
    Hi ALB

    I tried asking a question about callbacks a while back, but you didn't reply - one last attempt...

    I'm trying to determine the intended behaviour for OnSongEnd, as I want to have a callback for when a song ends, so I can take further action.

    The demo scene you provide seems to have this behaviour ->

    Song A is already playing.
    Start Song B with a callback for when it finishes (changes button colour in the example).
    Song A finishes, and invokes the callback intended for Song B.
    Song B finishes and does not invoke the callback.

    Is the above your intended behaviour, if so, what's it supposed to be used for?

    Thanks for any help...
     
  34. AntiLunchBox

    AntiLunchBox

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

    Sorry if I missed your question. This seems to be a bug I missed. Will look into it, that's not the intended behavior.

    ALB
     
  35. AntiLunchBox

    AntiLunchBox

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

    I just commited the fix. Should be available for download now.

    ALB
     
  36. AntiLunchBox

    AntiLunchBox

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

    Just released version 3.1

    Changelog in 3.1:
    • bug fix for song callbacks calling early
    • Added tag, layer, and name filters for AudioSourcePro event triggers

    ALB
     
  37. Gavin1969

    Gavin1969

    Joined:
    Apr 30, 2013
    Posts:
    5
    Thanks ALB! I'll take a look!

    Gavin
     
  38. Apiweb

    Apiweb

    Joined:
    Nov 26, 2011
    Posts:
    57
    I was trying to integrate the latest version of SMP, with the most current version of NGUI, and follow the instructions that says:
    I came across a problem, the latest version of Ngui has one more line, getting:
    Regarding this last line (return source;), I should also replace it, or should I keep it?
     
  39. Stilghar

    Stilghar

    Joined:
    Feb 4, 2013
    Posts:
    82
    Hi Alb,

    Any update on this? If you can't do it maybe you can explain what you had in mind so that I try myself...

    Thanks!

    Stilghar
     
  40. grp

    grp

    Joined:
    Apr 1, 2013
    Posts:
    2
    Hi,
    I think MuteMusic(bool) isn't working. I've only just started using SoundManager, I have my music loop going and I can mute it by using SoundManager.SetVolumeMusic(0f); but SoundManager.MuteMusic(true); has no effect.
     
  41. Ryuuguu

    Ryuuguu

    Joined:
    Apr 14, 2007
    Posts:
    358
    I had Singleton class conflict. Even though your Singleton class is in a namespace and you having
    Code (csharp):
    1. using antilunchbox
    C# still gets confused and calls the Singleton not in your name space. I changed all your class declaration to use

    Code (csharp):
    1. antilunchbox.Singleton
    and C# compiles it with no errors. I also tried out the demo scene and it all seems to work OK.
     
  42. grp

    grp

    Joined:
    Apr 1, 2013
    Posts:
    2
    With the latest version, the editor performance is really bad. When I add the SoundManager prefab Unity goes from using 1% CPU to maxing out a full core of the processor. I never have this problem with version 2 builds of SoundManager, only since I updated to version 3, is anyone else having this problem?
    Update: I downgraded my project to use an old pre-3.0 version and I don't get this problem.
     
    Last edited: Mar 3, 2014
  43. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489


    Hi ALB,

    I think I am hitting this problem. I started to get freezes in the editor and on android.

    This started after I added a call to SoundManager.PlaySFX in a OnCollissionEnter event. This can get called many time very quickly when an object is bouncing around.

    Because the bug is intermittent and is hard to reproduce, I can't say absolutely that there is a problem in PlaySFX. However, it is a bit too much of a coincidence to ignore.


    I have customized some of the soundmanagerpro scripts and so I am hoping you can supply a code fix. Even if you can just let me know which script has the bug. I have downloaded latest version from the asset store. So I can just copy the relevent section if you can point me in the right direction.

    THx.

    [edit]
    is it this code that fixes the bug in soundmanager_sfx_internal?

    if(info.currentIndexInPool >= index)
    info.currentIndexInPool = 0;
     
    Last edited: Mar 5, 2014
  44. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Hi,

    So I started using this in a project yesterday, and today I started getting a null pointer error when playing a sound effect.
    I added in a null check for the clip in the Load method inside SoundManager_SFX and its now working for me:
    Code (csharp):
    1. // If custom path fails, attempt to find it in our stored SFXs
    2. result = Instance.storedSFXs.Find(delegate(AudioClip clip) {
    3.     if(clip == null) {
    4.         return false;
    5.     }
    6.     return clipname == clip.name;
    7. });
    The issue started after I deleted an audio file from the the assets, and added it back in again with the same name. However I did not remove it from SoundManager before deleting it. I dont know if this should cause an issue, but something caused it, and this is the only thing I can think of. I have a tight deadline and I cannot try and replicate this now, but I will when im done on this project.

    Adam
     
  45. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey Apiweb, sorry I missed these. The forums is supposed to email me right away when somebody posts but that just hasn't been happening. I have been answering emails though. That Play SFX function actually returns the audiosource, so that line will suffice:

    return SoundManager.PlaySFX(mListener.gameObject, clip, false, volume, pitch);
     
  46. AntiLunchBox

    AntiLunchBox

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

    There is a Crossfade IEnumerator function that you have to call. It takes in two audiosources and a crossfade duration. You can copy that function and remove all the event calls at the beginning and start. And just call that to crossfade two audiosources.

    I'll add that next.

    ALB
     
  47. AntiLunchBox

    AntiLunchBox

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

    I'm not seeing that problem. I tried it in the demo scene and it seems to be working alright. Would you happen to be using sounds that aren't controlled by SMP? Mute only works on sounds that come from the soundmanager.

    ALB
     
  48. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Hey Zaddo, I fixed that bug a while back in an update.

    ALB
     
  49. AntiLunchBox

    AntiLunchBox

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

    I never tried that before! But I did just submit an update like 3 minutes ago that will throw that completely out the window anyway. That list is thrown out at launch and used to populate a dictionary. Should greatly improve efficiency. But now that I think about it, I can put in a null check when that happens too. Will look into it.

    ALB
     
  50. AntiLunchBox

    AntiLunchBox

    Joined:
    Jun 6, 2013
    Posts:
    470
    Changelog in 3.2:
    • Greatly improved SFX performance from O(n) to O(1)
    • Fixed audio subscription bug that would remove subscription after disable
     
unityunity