Hi!
What you're looking after is basically called 'Time Stretch'.It's the same method used in applications like SonicFoundary ACID which can loop any wave file at any speed.It's a little bit difficult to do it cause you could slower or fasten a wave file but at them same time its PITCH will change. There are lots of Math and theorical stuff involved in such projects,and sound quality is always the factor,and that's the difference betwwen different looping programs.
but one easy way could be theorically like this:
Create a channle with BASS and using 'ChannelSetAttributes' set frequency to whatever you like.doing so will speed up or down the channel playback.but when you alter the frequency PITCH also will change so you have to shift it back or forward to correct the tune.
you have to write a custom DSP to create a PITCH SHIFTER and correct the wave tunning.it should be a REAL TIME pitch shifer so it won't alter the SPEED again. since i guess there's no builtin Pitch shifter in DirectX 8.0,you have to write it yourslef.
but the most hard part comes here: you have to do some math to find the amount of PITCH SHIFTING needed for a particular SPEED. i mean you have to find a formula that can calculate needed amount of pitch shift by a given Frequency [which is set to channle ith 'channelSetAttributes'].got me?
so, 'channelSetAttributes' changes speed of wave file but also its pitch,and you correct the pitch with a REAL TIME custom DSP Callback.
the chalenge is to write a DSP routine in a way that it doesn't warble and lush up the sound so much. surely even the most simple routine could handle +20\-20 BPMs but then it starts to fall apart and shound shitty!
[sorry for many spell and gramar mistakes!
]