Why not just capture and fire an ‘event’ just before the end of the track ( a pre-defined time or number of samples ) and then kick it off a bit early.
I used two dynamic channels, ‘live’ and ‘fade’ when the live track is say 2 seconds from the end i switch the pointer as follows
fade = live
live = new channel
as these ‘variables’ contain just the pointer to the channel switching them does not cause any problems
then fade out the fade channel and fade in the live channel over 2 seconds using calulated step from the tickcount eg
Vol = (MaxVolume / FadeTimeinMilliseconds) * (CurrentTickCount – StartofFadeTickCount)
if the elapsed time is greater then the fade time i insert a VOL+MAX ( or replay-gain max )or whatever just to make sure the volume to sweeeeet
not only does the transition sound smooth as a babies backside you can extend this to a crossfade function for the 50 million dj’s out there
thats what i do anyway, and i think its cute
Stream them using FSOUND_Stream_Open and, for mp3s, try not specifying FSOUND_MPEGACCURATE. If the gap is still too large then you’ll have to start the second one before the first one’s finished like JimBob suggested.
Oh, and streams don’t take a huge amount of processor time or cause a lot of disk swapping – they’re very efficient.
However, documentation says that streams are time consumer against samples. Another point is that they have separate interface. It would be good if your can set Stream property of sample. Or use parent class to encapsulate common methods. Otherwise, for different sounds you should use different interface.
Please login first to submit.