Page 1 of 1
Sample sharing and callback questions
Posted: Sat Nov 14, 2009 5:42 pm
by headkaze
I have an xm that currently has 3 songs in one and I use SetPosition() to change which song is playing. I'm curious is it possible to have two separate xm's share samples to save memory? In that case I could split them into separate modules.
One other question is when I stop a song in the callback No$ crashes. Is it not possible to stop a song in the callback?
This is for the DS. Thanks.
Re: Sample sharing and callback questions
Posted: Tue Nov 17, 2009 10:31 am
by eKid
mmutil removes duplicate samples from the resulting soundbank, so you can split the songs into multiple XM's with duplicated samples and only one of each will be stored. (and you can also store duplicate samples inside the same XM and they will be removed, this is sometimes necessary because XM can't share samples between instruments)
You can't stop the module inside the callback, it's called from inside the update routine so it's unsafe. You'll have to stop it from outside somehow.
Re: Sample sharing and callback questions
Posted: Tue Nov 17, 2009 3:13 pm
by headkaze
Thanks for the info much appreciated
Re: Sample sharing and callback questions
Posted: Tue Nov 17, 2009 7:13 pm
by DeProgrammer
I appreciate the info, too. I've actually been watching this topic because I happened to want to know the same thing at about the same time this was posted.