Jump to content
Search Community

Tween fade out sound

clipclicmusic test
Moderator Tag

Recommended Posts

Hi Jack

 

I am finding fun ways to use your classes in all my projects...

I have been playing around with TweenMax for crossfading tracks on an MP3 player. Works a treat.

 

Question :

Am I right in thinking this will get rid of the Sound object and free up RAM ? I need to be sure that the Sound takes up no resources after the fade out, since there may be a hundred tracks playing one after the other...

 

TweenMax.to(root["sndChann" + activeSoundChann], 4, {volume:0,onComplete:fadeOutCompleteHandler});

function fadeOutCompleteHandler()

{

delete root["snd" + inactiveSound];

root["snd" + inactiveSound] = null;

 

}

 

Thnaks

 

Jason

But the

Link to comment
Share on other sites

I really couldn't speak to the Flash Player's handling of garbage collection and MP3s in your project right now and I just don't have time to set up tests, etc. You'd need to do those yourself, but I can tell you that TweenLite/Max should release their references within a couple seconds so they won't cause any problems. You'd obviously need to make sure you null any of your references to the MP3s and stop playing them, but I'd encourage you to run some tests of your own to verify whether or not things are being dumped from memory properly. Again, my apologies - I'm super swamped at the moment and don't have time to do that for ya (not that you were expecting me to). Let us know what you find out, though.

Link to comment
Share on other sites

For anyone who needs the info :

That seems to be good. I looped 296 sounds with crossfades toggling between two channels (I went to bed and slept while it played)

At launch it was using 22 MB of mem, next morning, 296 tracks later (I'm a big sleeper if anyone was counting !), the app was using 29 MB

So we can assume that "sound to null, stopping the SoundCHannel and deleting the SoundCHannel" is enough for garbage collection

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...