Re: [AD] Audio addon API / Re: Renaming of functions in kcm_audio addon

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 30-Nov-08, at 9:33 PM, Peter Wang wrote:
You can create ALLEGRO_SAMPLEs ahead of time.

Sure, but then you need to keep track of whether you should start bullet_sound[20] or bullet_sound[21]. It's the sort of thing I'd like not to have to think about. ;)

Actually, that might be a better way to go for these "detachable"
samples, too. Create a number of them ahead of time. When one finishes playing, instead of destroying it, automatically set its data pointer to
point to NULL to indicate it can be used for a later sound effect.

Good idea.
What would be a reasonable number for Allegro to keep around? 8? 10? That's similar to what A4 provides, if I recall correctly?

Hmm, yes, that is a problem.  Maybe we should have a function to force
all playing samples to stop.

That might be a good function to have anyway.

And/or use the recycling idea above instead of destroying ALLEGRO_SAMPLEs.

Makes sense, but I'm not sure how that solves the problem of destroying the data while it's being used by an ALLEGRO_SAMPLE? Or do they store a local copy of the sample data (best not, I'd have thought)?

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/