I am processing an audio sample (about 20minutes long) in small parts of several seconds.
At the moment my code freezes every now and then. The example below is a bit silly but is a minimal ‘working’ example which often stops within the first 100 iterations.
using FileIO, SampledSignals, LibSndFile, FFTW ls = load( "sample.ogg") for T in 10s:0.1s:1000s print( T) a = [ fft( ls[ (t-0.1s)..(t-0.1s+1s)]) for t in .1s:.1s:T] end
The next loop is similar except for the interval / indexing but seems to work without issues:
# this works ... for T in 10s:0.1s:1000s print( T) a = [ fft( ls[ t..(t+10s)]) for t in .1s:.1s:T] end
For me it is unclear why the first loop has a problem but the second loop not. Garbage collection within the first loop seem to stabilize the code, but makes it terribly slow, of course.
I would like to make clean and efficient code, but as I am not sure what the problem is (indexing / memory / IntervalSets), I cannot manage it… Any help is appreciated!