Warning: session_start(): open(/var/lib/php/sessions/sess_qp28ht22c0p4oh3ijlp1q8lmc4, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
static int bufSize = 40960;
static short[] loop1, loop2;
static volatile short[] nextLoop2;
static double speed2;
p {
loop1 = decodeWAVToStereoSamples(loadLibrary(#1400093));
loop2 = decodeWAVToStereoSamples(newFile(downloadsDir(), "103615__deller24__loop1.wav"));
VF1 vf = mixLoops();
playAudioFromSampleMakingFunction(bufSize, vf);
bot();
}
sS answer(S s) {
new Matches m;
if "speed *" speed2 = parseDouble($1);
File f = putInDirIfNotAbsolute(downloadsDir(), s);
nextLoop2 = decodeWAVToStereoSamples(f);
ret "OK";
}
static VF1 mixLoops() {
ret new VF1() {
int i = 0;
void get(short[] pair) {
int j = mod(2*iround(i/2*((double) l(loop2))/l(loop1)*speed2)), l(loop2));
pair[0] = (short) ((loop1[i] + loop2[j])/2);
pair[1] = (short) ((loop1[i+1] + loop2[j+1])/2);
i = (i+2) % l(loop1);
if (i == 0 && nextLoop2 != null) {
loop2 = nextLoop2;
nextLoop2 = null;
}
}
};
}