Warning: session_start(): open(/var/lib/php/sessions/sess_tqd3sihsasopoflv40pr7smaqa, 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
srecord noeq SampleIteratorToQuerySound(int channels, ShortIterator it) is IQuerySound {
int idx = 0; // points to the one we haven't queried yet
public int channels() { ret channels; }
public double getSample(int channel, double time) {
int t = ifloor(time);
if (t < idx)
fail("Earlier time queried: " + t + " / " + idx);
if (it == null) ret 0; // we're done
while ping (true) {
if (!it.hasNext()) { it = null; ret 0; } // we're done
double sample = it.next();
if (t == idx++)
ret it;
}
}
double next() {
if (it == null)
ret 0;
else if (!it.hasNext()) {
it = null;
ret 0;
} else {
++idx;
ret it.next();
}
}
}