Slick Forums

Discuss the Slick 2D Library
It is currently Wed May 22, 2013 6:24 am

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Thu Aug 16, 2012 6:09 pm 
Offline

Joined: Tue Jun 02, 2009 3:33 pm
Posts: 33
Your project looks amazing, thanks for your contribution!

Not fully related to it, but do you know if there is any way to unload a sound after not needed anymore? I have some kind of multi game app that have different bakcground music and I would like to remove them when they aren't in use.

Thanks in advance!


Top
 Profile  
 
PostPosted: Thu Aug 16, 2012 7:28 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1469
Code:
sound.stop();
Soundly.setSourceAudio(sound.getSource(), 0);
sound.clear();
AL10.alDeleteBuffers(sound.getAudio().getBufferID());


Admittedly not the cleanest solution... I've implemented this a little more nicely in Slick's Sound.


Top
 Profile  
 
PostPosted: Thu Aug 16, 2012 8:01 pm 
Offline

Joined: Tue Jun 02, 2009 3:33 pm
Posts: 33
davedes wrote:
Code:
sound.stop();
Soundly.setSourceAudio(sound.getSource(), 0);
sound.clear();
AL10.alDeleteBuffers(sound.getAudio().getBufferID());


Admittedly not the cleanest solution... I've implemented this a little more nicely in Slick's Sound.


Well for me it's sufficient!!! It's not a code that should need to be improved or portable to much ;)

I suppose the code you post is more or less the same that is inside AudioImpl, and what the release method of the Sound class calls, I'm right?

Thanks davedes!


Top
 Profile  
 
PostPosted: Wed May 08, 2013 3:16 pm 
Offline

Joined: Sun Apr 07, 2013 11:41 am
Posts: 4
The jar file is missing Soundly.class.
Can you please fix it?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group