If you want this done in real time It will be slow, possibly too slow to use for your desired application.
I think you are better off recording your new wave and playing it the same time as the old wave, and maybe recording the two together as a new file (beware feedback loops)
depending on what you want to do I can give you one *possible* concept which you may try to implement.
It is the idea that bouncing wave files is a matter of adding the two files amplitude to define the new wave amplitude peak.
in short, you need to add the two amplitude levels together to create a merged file. --which becomes more complicated when the volume levels are all positive rather than a measure of alternating current.
to set the resolution of the detection you will need to check the volume of the sound 44,100 times per second - check out nyquist frequency.
so something like sync rate 44,100(if it can be done)
you will need to add the values, however it will be slightly complicated.
you need to check the volume 44,100 times. and every second value needs to be made into a negative value. -these all need to be stored in sequence for all waves.(there may be potential bugs here regarding the posative\negative switch rate, if the waves merge in such a way as to create a posative movement for a duration greater than the sampling rate.)
here we get the positive and negative wave peaks for the 22.05Khz frequency which through resolution contains all other frequencies data. add the values for the two waves.
to create a merged image of the 22.05 frequency band should *in theory* create a merged wave of the two or more reference files creating a "bounced image" (if bugs persist, try the same process with every frequency between 20 and 20khz in intervals defined by the resolution frequency)
Keeping in mind that professional wave recording software has to shut down to its bare bones to bounce an average project of say (2.5 minutes * 8 waves) which takes a minute or two, It may be too slow for your use.
I dont even know if dark basic will behave as expected for Im not sure it was designed with wave manipulation in mind.(I'm a noob i may be wrong, please correct this statement if you know better)
out of curiosity, what are you making? recording software?
The coding for this project is way over my head, I just have a Bit of know how with regard to sound and the way its mapped out, I thought id share Ideas even if I cant convert them to practical code.
dunno If this helps at all, just an idea
kezzla
Sometimes I like to use words out of contents