I'm trying to build an audio player that has this specific feature: when you scroll to x sample time, [x to x + 4096] samples are played in a loop until you move the mouse to another place.
The samples are taken from the backing audio. The problem is, I fail to play them back as a continuous note: the looping is not seamless.
So far I tried to start and end the loop at zero crossings. This slightly improved it, but I can still hear the seamless looping.
One idea I had was to go to the frequency domain, remove all, but the max magnitude bin and do an inverse FFT afterwards. This, sort of works, the looping is better, not perfect, but better, however, removing all the other freq components from the loop leaves it really "dry", not resembling the original (missing the harmonics)
Is there a way to handle this in the time domain? Where should I look? Are there any filters/algorithms that could help me?